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

As of commit 84f5c2908, executing SQL commands (via SPI or otherwise)
requires having either an active Portal, or a caller-established
active snapshot.  We were simply Assert'ing that that's the case.
But we've now had a couple different reports of people testing
extensions that didn't meet this requirement, and were confused by
the resulting crash.  Let's convert the Assert to a test-and-elog,
in hopes of making the issue clearer for extension authors.

Per gripes from Liu Huailing and RekGRpth.  Back-patch to v11,
like the prior commit.

Discussion: 
https://postgr.es/m/oszpr01mb6215671e3c5956a034a080dfbe...@oszpr01mb6215.jpnprd01.prod.outlook.com
Discussion: https://postgr.es/m/17035-14607d308ac86...@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ec410c985e6d360f666e39be5609f3c4da5edc8f

Modified Files
--------------
src/backend/tcop/pquery.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Reply via email to