postgresql/src
Tom Lane 3853664265 Introduce GUC_NO_RESET flag.
Previously, the transaction-property GUCs such as transaction_isolation
could be reset after starting a transaction, because we marked them
as GUC_NO_RESET_ALL but still allowed a targeted RESET.  That leads to
assertion failures or worse, because those properties aren't supposed
to change after we've acquired a transaction snapshot.

There are some NO_RESET_ALL variables for which RESET is okay, so
we can't just redefine the semantics of that flag.  Instead introduce
a separate GUC_NO_RESET flag.  Mark "seed", as well as the transaction
property GUCs, as GUC_NO_RESET.

We have to disallow GUC_ACTION_SAVE as well as straight RESET, because
otherwise a function having a "SET transaction_isolation" clause can
still break things: the end-of-function restore action is equivalent
to a RESET.

No back-patch, as it's conceivable that someone is doing something
this patch will forbid (like resetting one of these GUCs at transaction
start, or "CREATE FUNCTION ... SET transaction_read_only = 1") and not
running into problems with it today.  Given how long we've had this
issue and not noticed, the side effects in non-assert builds can't be
too serious.

Per bug #17385 from Andrew Bille.

Masahiko Sawada

Discussion: https://postgr.es/m/17385-9ee529fb091f0ce5@postgresql.org
2022-09-27 11:47:12 -04:00
..
backend Introduce GUC_NO_RESET flag. 2022-09-27 11:47:12 -04:00
bin Add missing source files to pg_waldump/nls.mk 2022-09-25 17:48:03 +02:00
common Message style improvements 2022-09-24 18:41:25 -04:00
fe_utils meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
include Introduce GUC_NO_RESET flag. 2022-09-27 11:47:12 -04:00
interfaces Remove PQsendQuery support in pipeline mode 2022-09-23 18:21:22 +02:00
makefiles windows: remove date from version number in win32ver.rc 2022-09-26 11:38:02 -07:00
pl Introduce GUC_NO_RESET flag. 2022-09-27 11:47:12 -04:00
port meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
template Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
test Introduce GUC_NO_RESET flag. 2022-09-27 11:47:12 -04:00
timezone meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
tools ci: Add hint about downloadable logs to README 2022-09-26 20:02:26 -07:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split TESTDIR into TESTLOGDIR and TESTDATADIR 2022-09-19 18:03:17 -07:00
Makefile.shlib aix: No need to use mkldexport when we want to export all symbols 2022-09-09 19:11:49 -07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00