Re: assert in nested SQL procedure call in current HEAD - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: assert in nested SQL procedure call in current HEAD
Date
Msg-id CA+q6zcV4gyMW4Kvf_hpsdsug8wf8aeLOR3BNNGo82TSGoEzARg@mail.gmail.com
Whole thread Raw
In response to Re: assert in nested SQL procedure call in current HEAD  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: assert in nested SQL procedure call in current HEAD
Re: assert in nested SQL procedure call in current HEAD
List pgsql-hackers
> On 8 June 2018 at 06:20, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:

>  Joe> My colleague Yogesh Sharma discovered an assert in nested SQL
>  Joe> procedure calls after ROLLBACK is used. Minimal test case and
>  Joe> backtrace below. I have not yet tried to figure out exactly what
>  Joe> is going on beyond seeing that it occurs in pg_plan_query() where
>  Joe> the comment says "Planner must have a snapshot in case it calls
>  Joe> user-defined functions"...
>
>  Andrew> https://www.postgresql.org/message-id/29608.1518533639@sss.pgh.pa.us
>
> I added it to the open items list since nobody else seems to have taken
> notice; from Tom's linked message it seems this should be Peter E's bag?

I've taken a look at this - indeed, the situation looks similar to what
described in the linked message, namely after a transaction rollback and
creation of a new one no active snapshot was pushed. But in this particular
case the timeframe without an active snapshot is actually limited and includes
only some initialization and planning activity (after that a new one is
pushed). The commentary says that "Planner must have a snapshot in case it
calls user-defined functions." -  I tried to simulate this in order to see what
would happen, but got no errors. Is there a chance that it's an outdated
Assert?


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL vs SQL Standard
Next
From: David Fetter
Date:
Subject: Re: PostgreSQL vs SQL Standard