pgsql: Add new wal_level, logical, sufficient for logical decoding.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add new wal_level, logical, sufficient for logical decoding.
Date: 2013-12-11 00:07:23
Message-ID: E1VqXKl-0007om-Bg@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add new wal_level, logical, sufficient for logical decoding.

When wal_level=logical, we'll log columns from the old tuple as
configured by the REPLICA IDENTITY facility added in commit
07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65. This makes it possible
a properly-configured logical replication solution to correctly
follow table updates even if they change the chosen key columns,
or, with REPLICA IDENTITY FULL, even if the table has no key at
all. Note that updates which do not modify the replica identity
column won't log anything extra, making the choice of a good key
(i.e. one that will rarely be changed) important to performance
when wal_level=logical is configured.

Each insert, update, or delete to a catalog table will also log
the CMIN and/or CMAX values of stamped by the current transaction.
This is necessary because logical decoding will require access to
historical snapshots of the catalog in order to decode some data
types, and the CMIN/CMAX values that we may need in order to judge
row visibility may have been overwritten by the time we need them.

Andres Freund, reviewed in various versions by myself, Heikki
Linnakangas, KONDO Mitsumasa, and many others.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e55704d8b2fe522fbc9435acbb5bc59033478bd5

Modified Files
--------------
doc/src/sgml/backup.sgml | 4 +-
doc/src/sgml/config.sgml | 44 +-
doc/src/sgml/high-availability.sgml | 5 +-
src/backend/access/heap/heapam.c | 603 ++++++++++++++++++++-----
src/backend/access/rmgrdesc/heapdesc.c | 9 +
src/backend/access/rmgrdesc/xlogdesc.c | 1 +
src/backend/access/transam/twophase.c | 4 +-
src/backend/access/transam/xact.c | 41 +-
src/backend/access/transam/xlog.c | 8 +-
src/backend/catalog/index.c | 2 +-
src/backend/commands/trigger.c | 3 +-
src/backend/postmaster/postmaster.c | 4 +-
src/backend/utils/cache/relcache.c | 50 +-
src/backend/utils/misc/postgresql.conf.sample | 2 +-
src/bin/pg_controldata/pg_controldata.c | 2 +
src/include/access/heapam_xlog.h | 70 ++-
src/include/access/xact.h | 1 +
src/include/access/xlog.h | 8 +-
src/include/access/xlog_internal.h | 2 +-
src/include/utils/rel.h | 24 +
src/include/utils/relcache.h | 12 +-
src/tools/pgindent/typedefs.list | 3 +
22 files changed, 745 insertions(+), 157 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-12-11 00:34:47 pgsql: Add a new reloption, user_catalog_table.
Previous Message Tom Lane 2013-12-10 21:11:06 pgsql: Fix possible crash with nested SubLinks.