summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-12-22 16:38:42 +0900
committerMichael Paquier <michael@paquier.xyz>2021-12-22 16:38:42 +0900
commit28e1e5c2a91ccc2ad8f2749f36f0ac8eb3bca759 (patch)
treeb326f5cdf64002f1ee3d2f26adc4e599c1705282 /doc/src
parentda0d8a4545e639ca9c22dc2a0a10dcddcdf58761 (diff)
Correct comment and some documentation about REPLICA_IDENTITY_INDEX
catalog/pg_class.h was stating that REPLICA_IDENTITY_INDEX with a dropped index is equivalent to REPLICA_IDENTITY_DEFAULT. The code tells a different story, as it is equivalent to REPLICA_IDENTITY_NOTHING. The behavior exists since the introduction of replica identities, and fe7fd4e even added tests for this case but I somewhat forgot to fix this comment. While on it, this commit reorganizes the documentation about replica identities on the ALTER TABLE page, and a note is added about the case of dropped indexes with REPLICA_IDENTITY_INDEX. Author: Michael Paquier, Wei Wang Reviewed-by: Euler Taveira Discussion: https://postgr.es/m/OS3PR01MB6275464AD0A681A0793F56879E759@OS3PR01MB6275.jpnprd01.prod.outlook.com Backpatch-through: 10
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/alter_table.sgml51
1 files changed, 43 insertions, 8 deletions
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index beae516f3d1..ca959391ef2 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -820,16 +820,51 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
<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</literal>
- (the default for non-system tables) records the
- old values of the columns of the primary key, if any. <literal>USING INDEX</literal>
- 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>. <literal>FULL</literal> records the old values of all columns
- in the row. <literal>NOTHING</literal> records no information about the old row.
- (This is the default for system tables.)
+ except when logical replication is in use.
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.
+ <variablelist>
+ <varlistentry>
+ <term><literal>DEFAULT</literal></term>
+ <listitem>
+ <para>
+ Records the old values of the columns of the primary key, if any.
+ This is the default for non-system tables.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>USING INDEX <replaceable class="parameter">index_name</replaceable></literal></term>
+ <listitem>
+ <para>
+ Records the old values of the columns covered by the named index,
+ that must be unique, not partial, not deferrable, and include only
+ columns marked <literal>NOT NULL</literal>. If this index is
+ dropped, the behavior is the same as <literal>NOTHING</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>FULL</literal></term>
+ <listitem>
+ <para>
+ Records the old values of all columns in the row.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>NOTHING</literal></term>
+ <listitem>
+ <para>
+ Records no information about the old row. This is the default for
+ system tables.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</para>
</listitem>
</varlistentry>