Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc

Justin Pryzby <pryzby@telsasoft.com>

From: Justin Pryzby <pryzby@telsasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>, Jim Nasby <nasbyj@amazon.com>, pgsql-hackers@lists.postgresql.org
Date: 2021-06-23T04:25:18Z
Lists: pgsql-hackers
On Wed, Jun 23, 2021 at 12:07:11AM -0400, Tom Lane wrote:
> Justin Pryzby <pryzby@telsasoft.com> writes:
> > This causes the server to crash during FETCH.
> 
> > ts=# begin; declare b cursor for VALUES(1); fetch 100 in b;
> > BEGIN
> > DECLARE CURSOR
> > server closed the connection unexpectedly
> >         This probably means the server terminated abnormally
> >         before or while processing the request.
> > The connection to the server was lost. Attempting reset: Failed.
> 
> Hm, works for me:

I think it's because I had old pg_stat_statements module, and hadn't make -C contrib.

Sorry for the noise.

-- 
Justin



Commits

  1. Restore the portal-level snapshot for simple expressions, too.

  2. Centralize the logic for protective copying of utility statements.

  3. Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.

  4. Avoid taking a new snapshot for an immutable simple expression in plpgsql.