public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Paquier <[email protected]>
To: [email protected] <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Confused comment about drop replica identity index
Date: Mon, 20 Dec 2021 20:11:04 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <OS3PR01MB62750A0A1A282E9E0148172B9E7B9@OS3PR01MB6275.jpnprd01.prod.outlook.com>
References: <OS3PR01MB6275464AD0A681A0793F56879E759@OS3PR01MB6275.jpnprd01.prod.outlook.com>
<CAExHW5uWwcV0-=JQXYhEpnEtmwmZQsh0c1N3cxxBYRhwE9WuvQ@mail.gmail.com>
<Yblf/[email protected]>
<OS3PR01MB6275A10D03572E27C4E2C9769E769@OS3PR01MB6275.jpnprd01.prod.outlook.com>
<[email protected]>
<OS3PR01MB62750A124D384B4E96CA43F19E779@OS3PR01MB6275.jpnprd01.prod.outlook.com>
<OS3PR01MB62750A0A1A282E9E0148172B9E7B9@OS3PR01MB6275.jpnprd01.prod.outlook.com>
On Mon, Dec 20, 2021 at 03:46:13AM +0000, [email protected] wrote:
> Here is a patch to correct wrong comment about
> REPLICA_IDENTITY_INDEX, And improve the pg-doc.
That's mostly fine. I have made some adjustments as per the
attached.
+ The default for non-system tables. Records the old values of the columns
+ of the primary key, if any. The default for non-system tables.
The same sentence is repeated twice.
+ Records no information about the old row.(This is the
default for system tables.)
For consistency with the rest, this could drop the parenthesis for the
second sentence.
+ <term><literal>USING INDEX index_name</literal></term>
This should use <replaceable> as markup for index_name.
Pondering more about this thread, I don't think we should change the
existing behavior in the back-branches, but I don't have any arguments
about doing such changes on HEAD to help the features being worked
on, either. So I'd like to apply and back-patch the attached, as a
first step, to fix the inconsistency.
--
Michael
Attachments:
[text/x-diff] v2-0001-Correct-comment-and-documentation-about-REPLICA_I.patch (3.6K, ../[email protected]/2-v2-0001-Correct-comment-and-documentation-about-REPLICA_I.patch)
download | inline diff:
From 05fe07224a5f31f3d28da088f302772724c00dd4 Mon Sep 17 00:00:00 2001
From: Michael Paquier <[email protected]>
Date: Mon, 20 Dec 2021 20:09:59 +0900
Subject: [PATCH v2] Correct comment and documentation about
REPLICA_IDENTITY_INDEX
---
src/include/catalog/pg_class.h | 2 +-
doc/src/sgml/ref/alter_table.sgml | 51 ++++++++++++++++++++++++++-----
2 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h
index 93338d267c..b46299048e 100644
--- a/src/include/catalog/pg_class.h
+++ b/src/include/catalog/pg_class.h
@@ -182,7 +182,7 @@ DECLARE_INDEX(pg_class_tblspc_relfilenode_index, 3455, ClassTblspcRelfilenodeInd
/*
* an explicitly chosen candidate key's columns are used as replica identity.
* Note this will still be set if the index has been dropped; in that case it
- * has the same meaning as 'd'.
+ * has the same meaning as 'n'.
*/
#define REPLICA_IDENTITY_INDEX 'i'
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 8f14e4a5c4..a76e2e7322 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -872,16 +872,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>
--
2.34.1
[application/pgp-signature] signature.asc (833B, ../[email protected]/3-signature.asc)
download
view thread (17+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Confused comment about drop replica identity index
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox