postgresql/src/backend
Tom Lane ec410c985e 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/OSZPR01MB6215671E3C5956A034A080DFBEEC9@OSZPR01MB6215.jpnprd01.prod.outlook.com
Discussion: https://postgr.es/m/17035-14607d308ac8643c@postgresql.org
2021-07-31 11:50:14 -04:00
..
access Update obsolete comment that still referred to CheckpointLock 2021-07-30 12:53:03 +03:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog Pre branch pgindent / pgperltidy run 2021-06-28 11:05:54 -04:00
commands Don't allow to set replication slot_name as ''. 2021-07-19 10:54:21 +05:30
executor postgres_fdw: Fix handling of pending asynchronous requests. 2021-07-30 17:00:01 +09:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit jit: Don't inline functions that access thread-locals. 2021-07-22 15:08:10 +12:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Don't assume GSSAPI result strings are null-terminated. 2021-06-23 14:01:32 -04:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Change the name of the Result Cache node to Memoize 2021-07-14 12:45:00 +12:00
optimizer Fix incorrect comment for get_agg_clause_costs 2021-07-26 14:56:09 +12:00
parser Fix bugs in polymorphic-argument resolution for multiranges. 2021-07-27 15:01:49 -04:00
partitioning Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:21:35 +09:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
postmaster Remove unnecessary assertion in postmaster.c 2021-07-15 15:00:52 +09:00
regex Fix performance issue in new regex match-all detection code. 2021-05-03 11:42:31 -04:00
replication Remove unused argument in apply_handle_commit_internal(). 2021-07-30 08:21:59 +05:30
rewrite Reject cases where a query in WITH rewrites to just NOTIFY. 2021-07-09 11:02:26 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Error message refactoring 2021-06-27 09:41:16 +02:00
storage Deduplicate choice of horizon for a relation procarray.c. 2021-07-24 20:30:26 -07:00
tcop Use elog, not Assert, to report failure to provide an outer snapshot. 2021-07-31 11:50:14 -04:00
tsearch Fix typos and grammar in comments and docs 2021-04-19 11:32:30 +09:00
utils Fix corner-case errors and loss of precision in numeric_power(). 2021-07-31 11:23:48 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00