On Mon, Oct 14, 2019 at 6:27 PM Pepe TD Vo <pepevo@xxxxxxxxx> wrote: > SELECT pr_mig_bnft_hist_actn_ldim(); > > execute the store funtion no error but two tables are the same and didn't delete and/or insert any from one to other; > As others have already pointed out, you seems to return a trigger tuple from a normal function, so first step is to remove the "RETURN NEW". Then I would add a couple of RAISE statements because it sounds me strange that the function is invoked without producing any error nor results. Last, I would change the DELETE with a TRUNCATE, assuming you are not inserting the very same quantity of rows on the next step. Luca