postgresql/src/backend/utils
Tom Lane 180ce0af33 Fix issues with checks for unsupported transaction states in Hot Standby.
The GUC check hooks for transaction_read_only and transaction_isolation
tried to check RecoveryInProgress(), so as to disallow setting read/write
mode or serializable isolation level (respectively) in hot standby
sessions.  However, GUC check hooks can be called in many situations where
we're not connected to shared memory at all, resulting in a crash in
RecoveryInProgress().  Among other cases, this results in EXEC_BACKEND
builds crashing during child process start if default_transaction_isolation
is serializable, as reported by Heikki Linnakangas.  Protect those calls
by silently allowing any setting when not inside a transaction; which is
okay anyway since these GUCs are always reset at start of transaction.

Also, add a check to GetSerializableTransactionSnapshot() to complain
if we are in hot standby.  We need that check despite the one in
check_XactIsoLevel() because default_transaction_isolation could be
serializable.  We don't want to complain any sooner than this in such
cases, since that would prevent running transactions at all in such a
state; but a transaction can be run, if SET TRANSACTION ISOLATION is done
before setting a snapshot.  Per report some months ago from Robert Haas.

Back-patch to 9.1, since these problems were introduced by the SSI patch.

Kevin Grittner and Tom Lane, with ideas from Heikki Linnakangas
2012-08-24 13:09:17 -04:00
..
adt Fix cascading privilege revoke to notice when privileges are still held. 2012-08-23 17:25:23 -04:00
cache Fix race condition in enum value comparisons. 2012-07-01 17:12:59 -04:00
error Tweak previous patch to ensure edata->filename always gets initialized. 2011-11-30 00:37:14 -05:00
fmgr Ignore SECURITY DEFINER and SET attributes for a PL's call handler. 2012-05-30 23:28:10 -04:00
hash Fix the size of predicate lock manager's shared memory hash tables at creation. 2011-04-11 13:43:31 +03:00
init Fix issues with checks for unsupported transaction states in Hot Standby. 2012-08-24 13:09:17 -04:00
mb Back-patch addition of pg_wchar-to-multibyte conversion functionality. 2012-07-10 16:53:27 -04:00
misc Improve and simplify CREATE EXTENSION's management of GUC variables. 2011-10-05 20:44:22 -04:00
mmgr Run a portal's cleanup hook immediately when pushing it to FAILED state. 2012-02-15 16:18:39 -05:00
resowner pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
sort Fix failure to account for memory used by tuplestore_putvalues(). 2011-06-15 14:05:39 -04:00
time Fix race condition in enum value comparisons. 2012-07-01 17:12:59 -04:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Per-column collation support 2011-02-08 23:04:18 +02:00
Gen_dummy_probes.sed Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
Gen_fmgrtab.pl Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
generate-errcodes.pl Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00