Re: can't call function to delete the table

Luca Ferrari <[email protected]> Wed, 16 Oct 2019 09:27:50 +0200
Newsgroups gmane.comp.db.postgresql.admin
Message-ID <CAKoxK+6-XO8pDGGWv7RpurTdU=EmB8rskeY2Od2BvKL2GRaPRQ@mail.gmail.com>
On Mon, Oct 14, 2019 at 6:27 PM Pepe TD Vo <[email protected]> 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