Re: Executing a Function with an INSERT INTO command fails

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: TalGloz <glozmantal(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Executing a Function with an INSERT INTO command fails
Date: 2018-08-29 16:34:06
Message-ID: CAKFQuwasQV2Wn+tJx6AGqnT11HsRzvmv6QaX4T9hHei3_9kA7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 29, 2018 at 9:27 AM, TalGloz <glozmantal(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message TalGloz 2018-08-29 16:47:34 Re: Executing a Function with an INSERT INTO command fails
Previous Message Tom Lane 2018-08-29 16:33:07 Re: Executing a Function with an INSERT INTO command fails