Re: Executing a Function with an INSERT INTO command fails - Mailing list pgsql-general

From David G. Johnston
Subject Re: Executing a Function with an INSERT INTO command fails
Date
Msg-id CAKFQuwasQV2Wn+tJx6AGqnT11HsRzvmv6QaX4T9hHei3_9kA7g@mail.gmail.com
Whole thread Raw
In response to RE: Executing a Function with an INSERT INTO command fails  (TalGloz <glozmantal@gmail.com>)
Responses Re: Executing a Function with an INSERT INTO command fails
List pgsql-general
On Wed, Aug 29, 2018 at 9:27 AM, TalGloz <glozmantal@gmail.com> wrote:
This is very strange, even if I comment all the loops in the function and
leave only the INSERT INTO command the insert still doesn't happen.

Add "RAISE ERROR" to the top function's BEGIN block and verify that the next time you run your calling query it indeed fails.  I'm suspecting that the code you are iterating over is not the same code that is being executed (search_path dynamics probably).

That or you are looking in from another session without committing the first one.

David J.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Executing a Function with an INSERT INTO command fails
Next
From: TalGloz
Date:
Subject: Re: Executing a Function with an INSERT INTO command fails