postgresql/src/backend
Tom Lane 68855c0387 Allow parallel workers to cope with a newly-created session user ID.
Parallel workers failed after a sequence like
	BEGIN;
	CREATE USER foo;
	SET SESSION AUTHORIZATION foo;
because check_session_authorization could not see the uncommitted
pg_authid row for "foo".  This is because we ran RestoreGUCState()
in a separate transaction using an ordinary just-created snapshot.
The same disease afflicts any other GUC that requires catalog lookups
and isn't forgiving about the lookups failing.

To fix, postpone RestoreGUCState() into the worker's main transaction
after we've set up a snapshot duplicating the leader's.  This affects
check_transaction_isolation and check_transaction_deferrable, which
think they should only run during transaction start.  Make them
act like check_transaction_read_only, which already knows it should
silently accept the value when InitializingParallelWorker.

Per bug #18545 from Andrey Rachitskiy.  Back-patch to all
supported branches, because this has been wrong for awhile.

Discussion: https://postgr.es/m/18545-feba138862f19aaa@postgresql.org
2024-07-31 18:54:10 -04:00
..
access Allow parallel workers to cope with a newly-created session user ID. 2024-07-31 18:54:10 -04:00
bootstrap Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:13 -07:00
catalog Reset relhassubclass upon attaching table as a partition 2024-07-24 12:38:18 +02:00
commands Allow parallel workers to cope with a newly-created session user ID. 2024-07-31 18:54:10 -04:00
executor Expand comments and add an assertion in nodeModifyTable.c. 2024-06-27 19:21:13 -07:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Fix illegal attribute propagation in LLVM JIT. 2024-04-10 12:15:59 +12:00
lib Fix lock assertions in dshash.c. 2022-07-11 15:51:47 +12:00
libpq libpq: Use strerror_r instead of strerror 2024-07-28 09:26:48 +02:00
main Fix outdated --help message for postgres -f 2022-08-15 13:37:42 +09:00
nodes Further fixes for MULTIEXPR_SUBLINK fix. 2022-09-06 16:38:18 -04:00
optimizer Fix infer_arbiter_indexes() to not assume resultRelation is 1. 2024-06-11 17:57:46 -04:00
parser Avoid unhelpful internal error for incorrect recursive-WITH queries. 2024-07-14 13:49:46 -04:00
partitioning Fix incorrect pruning of NULL partition for boolean IS NOT clauses 2024-02-20 12:51:38 +13:00
po Translation updates 2024-05-06 12:15:05 +02:00
port Close socket in case of errors in setting non-blocking 2024-01-17 11:24:11 +01:00
postmaster Avoid deadlock during orphan temp table removal. 2024-04-02 14:59:04 -04:00
regex Avoid character classification in regex escape parsing. 2023-04-21 08:21:04 -07:00
replication Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:08 +09:00
rewrite Correctly check updatability of columns targeted by INSERT...DEFAULT. 2024-07-20 13:40:15 -04:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics Fix incorrectly reported stats kind in "can't happen" ERROR 2024-03-05 16:19:26 +13:00
storage Fix lost Windows socket EOF events. 2024-07-13 15:45:28 +12:00
tcop Be more rigorous about local variables in PostgresMain(). 2023-07-10 12:14:34 -04:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Detect integer overflow in array_set_slice(). 2024-07-23 21:59:02 -05: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 Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
nls.mk Translation updates 2020-08-10 15:21:18 +02:00