postgresql/src/backend/commands
Tom Lane 7abaa6b9d3 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:04 -04:00
..
aggregatecmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
alter.c Syntax support and documentation for event triggers. 2012-07-18 10:16:16 -04:00
analyze.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
async.c Fix NOTIFY to cope with I/O problems, such as out-of-disk-space. 2012-06-29 00:51:34 -04:00
cluster.c Replace int2/int4 in C code with int16/int32 2012-06-25 01:51:46 +03:00
collationcmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
comment.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
constraint.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
conversioncmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
copy.c Skip text->binary conversion of unnecessary columns in contrib/file_fdw. 2012-07-12 16:26:59 -04:00
createas.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
dbcommands.c Add more message pluralization 2012-06-15 02:02:02 +03:00
define.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
discard.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
dropcmds.c Syntax support and documentation for event triggers. 2012-07-18 10:16:16 -04:00
event_trigger.c Make new event trigger facility actually do something. 2012-07-20 11:39:01 -04:00
explain.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
extension.c Disallow extensions from owning the schema they are assigned to. 2012-08-15 11:28:03 -04:00
foreigncmds.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
functioncmds.c Centralize the logic for detecting misplaced aggregates, window funcs, etc. 2012-08-10 11:36:15 -04:00
indexcmds.c Centralize the logic for detecting misplaced aggregates, window funcs, etc. 2012-08-10 11:36:15 -04:00
lockcmds.c Repair comment mangled by a pgindent run long ago 2012-06-21 15:37:05 -04:00
Makefile Syntax support and documentation for event triggers. 2012-07-18 10:16:16 -04:00
opclasscmds.c Improve reporting of permission errors for array types 2012-06-15 22:55:03 +03:00
operatorcmds.c Improve reporting of permission errors for array types 2012-06-15 22:55:03 +03:00
portalcmds.c Restructure SELECT INTO's parsetree representation into CreateTableAsStmt. 2012-03-19 21:38:12 -04:00
prepare.c Centralize the logic for detecting misplaced aggregates, window funcs, etc. 2012-08-10 11:36:15 -04:00
proclang.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
schemacmds.c Make new event trigger facility actually do something. 2012-07-20 11:39:01 -04:00
seclabel.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
sequence.c Fix longstanding crash-safety bug with newly-created-or-reset sequences. 2012-07-25 17:42:23 -04:00
tablecmds.c Fix dependencies generated during ALTER TABLE ADD CONSTRAINT USING INDEX. 2012-08-11 12:51:24 -04:00
tablespace.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
trigger.c Centralize the logic for detecting misplaced aggregates, window funcs, etc. 2012-08-10 11:36:15 -04:00
tsearchcmds.c Extend object access hook framework to support arguments, and DROP. 2012-03-09 14:34:56 -05:00
typecmds.c Centralize the logic for detecting misplaced aggregates, window funcs, etc. 2012-08-10 11:36:15 -04:00
user.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
vacuum.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
vacuumlazy.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
variable.c Fix issues with checks for unsupported transaction states in Hot Standby. 2012-08-24 13:09:04 -04:00
view.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00