aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2013-11-08 12:30:43 -0500
committerRobert Haas <rhaas@postgresql.org>2013-11-08 12:30:43 -0500
commit07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65 (patch)
tree7fa0f7c8d7b765b3e901512faef90759904d047c /doc/src
parentb97ee66cc1f9319f7b457e7d8a78aab711da2dda (diff)
downloadpostgresql-07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65.tar.gz
postgresql-07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65.zip
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml24
-rw-r--r--doc/src/sgml/ref/alter_table.sgml19
2 files changed, 43 insertions, 0 deletions
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
@@ -1863,6 +1863,19 @@
</row>
<row>
+ <entry><structfield>relreplident</structfield></entry>
+ <entry><type>char</type></entry>
+ <entry></entry>
+ <entry>
+ Columns used to form <quote>replica identity</> for rows:
+ <literal>d</> = default (primary key, if any),
+ <literal>n</> = nothing,
+ <literal>f</> = all columns
+ <literal>i</> = index with indisreplident set, or default
+ </entry>
+ </row>
+
+ <row>
<entry><structfield>relfrozenxid</structfield></entry>
<entry><type>xid</type></entry>
<entry></entry>
@@ -3658,6 +3671,17 @@
</row>
<row>
+ <entry><structfield>indisreplident</structfield></entry>
+ <entry><type>bool</type></entry>
+ <entry></entry>
+ <entry>
+ If true this index has been chosen as <quote>replica identity</>
+ using <command>ALTER TABLE ... REPLICA IDENTITY USING INDEX
+ ...</>
+ </entry>
+ </row>
+
+ <row>
<entry><structfield>indkey</structfield></entry>
<entry><type>int2vector</type></entry>
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
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 ] <replaceable class="PARAMETER">name</replaceable>
NOT OF
OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
SET TABLESPACE <replaceable class="PARAMETER">new_tablespace</replaceable>
+ REPLICA IDENTITY {DEFAULT | USING INDEX <replaceable class="PARAMETER">index_name</replaceable> | FULL | NOTHING}
<phrase>and <replaceable class="PARAMETER">table_constraint_using_index</replaceable> is:</phrase>
@@ -580,6 +581,24 @@ ALTER TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable>
</varlistentry>
<varlistentry>
+ <term><literal>REPLICA IDENTITY</literal></term>
+ <listitem>
+ <para>
+ 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. <literal>DEFAULT</> records the
+ old values of the columns of the primary key, if any. <literal>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
+ <literal>NOT NULL</>. <literal>FULL</> records the old values of all columns
+ in the row. <literal>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.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>RENAME</literal></term>
<listitem>
<para>