BUG #17035: assert after commit

The Post Office <noreply@postgresql.org>

From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: rekgrpth@gmail.com
Date: 2021-05-26T06:55:18Z
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17035
Logged by:          RekGRpth
Email address:      rekgrpth@gmail.com
PostgreSQL version: 13.3
Operating system:   docker alpine
Description:        

after this commit

https://github.com/postgres/postgres/commit/d18ee6f92d9a22b4fae57f515797b2196bf385c7

I got assert

TRAP: FailedAssertion("portal != NULL", File: "pquery.c", Line: 1758)

in my plugin

https://github.com/RekGRpth/pg_task

Commits

  1. Use elog, not Assert, to report failure to provide an outer snapshot.

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