From 07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 8 Nov 2013 12:30:43 -0500 Subject: Add the notion of REPLICA IDENTITY for a table. Pending patches for logical replication will use this to determine which columns of a tuple ought to be considered as its candidate key. Andres Freund, with minor, mostly cosmetic adjustments by me --- doc/src/sgml/catalogs.sgml | 24 ++++++++++++++++++++++++ doc/src/sgml/ref/alter_table.sgml | 19 +++++++++++++++++++ 2 files changed, 43 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 9af4697a47b..9388df5ac27 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1862,6 +1862,19 @@ relations other than some materialized views) + + relreplident + char + + + Columns used to form replica identity for rows: + d = default (primary key, if any), + n = nothing, + f = all columns + i = index with indisreplident set, or default + + + relfrozenxid xid @@ -3657,6 +3670,17 @@ + + indisreplident + bool + + + If true this index has been chosen as replica identity + using ALTER TABLE ... REPLICA IDENTITY USING INDEX + ... + + + indkey int2vector diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 2609d4a8eaf..89649a2aa48 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -69,6 +69,7 @@ ALTER TABLE [ IF EXISTS ] name NOT OF OWNER TO new_owner SET TABLESPACE new_tablespace + REPLICA IDENTITY {DEFAULT | USING INDEX index_name | FULL | NOTHING} and table_constraint_using_index is: @@ -579,6 +580,24 @@ ALTER TABLE [ IF EXISTS ] name + + REPLICA IDENTITY + + + This form changes the information which is written to the write-ahead log + to identify rows which are updated or deleted. This option has no effect + except when logical replication is in use. DEFAULT records the + old values of the columns of the primary key, if any. USING INDEX + records the old values of the columns covered by the named index, which + must be unique, not partial, not deferrable, and include only columns marked + NOT NULL. FULL records the old values of all columns + in the row. NOTHING records no information about the old row. + In all cases, no old values are logged unless at least one of the columns + that would be logged differs between the old and new versions of the row. + + + + RENAME -- cgit v1.2.3