postgresql/src/backend/commands
Simon Riggs efc16ea520 Allow read only connections during recovery, known as Hot Standby.
Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record.

New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far.

This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required.

Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit.

Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.
2009-12-19 01:32:45 +00:00
..
aggregatecmds.c Support use of function argument names to identify which actual arguments 2009-10-08 02:39:25 +00:00
alter.c Add large object access control. 2009-12-11 03:34:57 +00:00
analyze.c Prevent indirect security attacks via changing session-local state within 2009-12-09 21:57:51 +00:00
async.c Create a multiplexing structure for signals to Postgres child processes. 2009-07-31 20:26:23 +00:00
cluster.c Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjust 2009-10-05 19:24:49 +00:00
comment.c Add large object access control. 2009-12-11 03:34:57 +00:00
constraint.c Add exclusion constraints, which generalize the concept of uniqueness to 2009-12-07 05:22:23 +00:00
conversioncmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
copy.c Add an EXPLAIN (BUFFERS) option to show buffer-usage statistics. 2009-12-15 04:57:48 +00:00
dbcommands.c Allow read only connections during recovery, known as Hot Standby. 2009-12-19 01:32:45 +00:00
define.c Define a new, more extensible syntax for COPY options. 2009-09-21 20:10:21 +00:00
discard.c Update copyright for 2009. 2009-01-01 17:24:05 +00:00
explain.c Several fixes for EXPLAIN (FORMAT YAML), plus one for EXPLAIN (FORMAT JSON). 2009-12-16 22:16:16 +00:00
foreigncmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
functioncmds.c Keep track of language's trusted flag in InlineCodeBlock. Needed to support DO blocks for languages that have both trusted and untrusted variants. 2009-11-06 21:57:57 +00:00
indexcmds.c Add exclusion constraints, which generalize the concept of uniqueness to 2009-12-07 05:22:23 +00:00
lockcmds.c Allow read only connections during recovery, known as Hot Standby. 2009-12-19 01:32:45 +00:00
Makefile Support deferrable uniqueness constraints. 2009-07-29 20:56:21 +00:00
opclasscmds.c Update copyright for 2009. 2009-01-01 17:24:05 +00:00
operatorcmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
portalcmds.c Fix snapshot management, take two. 2009-10-07 16:27:18 +00:00
prepare.c Add support for invoking parser callback hooks via SPI and in cached plans. 2009-11-04 22:26:08 +00:00
proclang.c Implement the DO statement to support execution of PL code without having 2009-09-22 23:43:43 +00:00
schemacmds.c Prevent indirect security attacks via changing session-local state within 2009-12-09 21:57:51 +00:00
sequence.c Allow read only connections during recovery, known as Hot Standby. 2009-12-19 01:32:45 +00:00
tablecmds.c Add an EXPLAIN (BUFFERS) option to show buffer-usage statistics. 2009-12-15 04:57:48 +00:00
tablespace.c Allow read only connections during recovery, known as Hot Standby. 2009-12-19 01:32:45 +00:00
trigger.c Add a WHEN clause to CREATE TRIGGER, allowing a boolean expression to be 2009-11-20 20:38:12 +00:00
tsearchcmds.c Support use of function argument names to identify which actual arguments 2009-10-08 02:39:25 +00:00
typecmds.c binary migration: pg_migrator 2009-12-19 00:47:57 +00:00
user.c Add a hook to CREATE/ALTER ROLE to allow an external module to check the 2009-11-18 21:57:56 +00:00
vacuum.c Allow read only connections during recovery, known as Hot Standby. 2009-12-19 01:32:45 +00:00
vacuumlazy.c Allow read only connections during recovery, known as Hot Standby. 2009-12-19 01:32:45 +00:00
variable.c Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside security-definer 2009-09-03 22:08:05 +00:00
view.c Don't treat NEW and OLD as reserved words anymore. For the purposes of rules 2009-11-05 23:24:27 +00:00