Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzGZk-0002XM-H2 for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Dec 2021 11:11:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mzGZi-00011p-Pf for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Dec 2021 11:11:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzGZg-00011g-Oz for pgsql-hackers@lists.postgresql.org; Mon, 20 Dec 2021 11:11:26 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzGZY-0002gG-1T for pgsql-hackers@lists.postgresql.org; Mon, 20 Dec 2021 11:11:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 24A4132004CE; Mon, 20 Dec 2021 06:11:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 20 Dec 2021 06:11:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=I46ZbLVFAQisz+QS+IS9iB4zt6W 9azVQYJ6n9v/oTY8=; b=UuaRFdsfNKxEM9OS0AQT1BlQYodZ030MUmVwLG5picO VyeyiMrdhSJ70W/zKqNzHLLY9Sg1h+gn+bh/HnhaBi/iz/H78vau6Oej39nsR/KN c8HyYsvZbqtQTnSBUwF7zXLCBr+zIj89HPICyt8f1Hx6KUDSe46CGcb5KqbaxSm4 mCvdmnaIeutHufxJ0nZD4oVSCkvUvZOYpwfoUsryPyO/w7bjiZZSSKfl/2TxJwnT 9NF27htM50Cws4qPaCnayGWNUPMXtgT9x1wKUTp0C7FCIi40f47cpbiR5xz6kqjL 6PxqZlGAvvGsXMDJln4eGTOVgh/KXI1L5TOz3Bxjumg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=I46ZbL VFAQisz+QS+IS9iB4zt6W9azVQYJ6n9v/oTY8=; b=IIuCt+CFGERJS1GxdHbBxz tyuhv5l02GoKjoSTCnAJonsuN+UTTCP1ap2sFJpUDsmp5QIYgAduFTbi9BJgkYlJ 8xbdP6AKmDFMfWcCoZzL0zg8yMWkCbkMPpXeEuz9cUZRrxKeI7hmhQlyYbA+frKt 0mFxL/LzfVhd8NzeCqldrO68nUX/4SFI78X3AKx3sKUH6cYS+ebAl6Q9WIocfSgF kW1YQHS9UtEK/z6ng+WQoqz/NoO19hLi6JRDN6HNAIqGFAnAL/mo6qqRlpRmiXq/ QIpyFUWOXZ2WTluq1pcOo/y6OBo8VK+IWC7Ipm9XYQ3KxAYdJz91BGoCQUoxGHxg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddtvddgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlfeehmdenucfjughrpeffhf fvuffkfhggtggujgesghdtroertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpeehgedtueehkeetgeeuvedtleelkeeggeefteefjeejgfekheeikeevjeehudejheen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthh grvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Dec 2021 06:11:08 -0500 (EST) Date: Mon, 20 Dec 2021 20:11:04 +0900 From: Michael Paquier To: "wangw.fnst@fujitsu.com" Cc: Ashutosh Bapat , "pgsql-hackers@lists.postgresql.org" Subject: Re: Confused comment about drop replica identity index Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="C3KObG+dG5/GCVsd" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --C3KObG+dG5/GCVsd Content-Type: multipart/mixed; boundary="GRO7Xxh9t5V5i0Lw" Content-Disposition: inline --GRO7Xxh9t5V5i0Lw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 20, 2021 at 03:46:13AM +0000, wangw.fnst@fujitsu.com 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.=20 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. + USING INDEX index_name This should use 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 --GRO7Xxh9t5V5i0Lw Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Correct-comment-and-documentation-about-REPLICA_I.patch" Content-Transfer-Encoding: quoted-printable =46rom 05fe07224a5f31f3d28da088f302772724c00dd4 Mon Sep 17 00:00:00 2001 =46rom: Michael Paquier 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 identi= ty. * 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' =20 diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_tab= le.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 numer= ic_literal, REM This form changes the information which is written to the write-ahea= d log to identify rows which are updated or deleted. This option has no e= ffect - except when logical replication is in use. DEFAULT - (the default for non-system tables) records the - old values of the columns of the primary key, if any. USIN= G INDEX - records the old values of the columns covered by the named index, wh= ich - must be unique, not partial, not deferrable, and include only column= s marked - NOT NULL. FULL records the ol= d values of all columns - in the row. NOTHING 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 co= lumns that would be logged differs between the old and new versions of the= row. + + + DEFAULT + + + Records the old values of the columns of the primary key, if any. + This is the default for non-system tables.=20 + + + + + + USING INDEX index_n= ame + + + 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 NOT NULL. If this index is + dropped, the behavior is the same as NOTHING. + + + + + + FULL + + + Records the old values of all columns in the row. + + + + + + NOTHING + + + Records no information about the old row. This is the default for + system tables. + + + + --=20 2.34.1 --GRO7Xxh9t5V5i0Lw-- --C3KObG+dG5/GCVsd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmHAZMgACgkQnvQgOdby QH1NaA/+J1Obj/b6U7YlM0LZ4VMLXuRHmOFRIRQeu72s0X3WGpGpwAoqCPaYMD0G jlT3NIoDOGkqUdilYory91EEjWjzBbtCXMzIOzUM9NswTaH1MURCoN9FzgbtcZ0y sSkIwY9z3QKprKwfYFr2A0BHzHut5+KqvP59hbQzrl7B59RrJVbtwneyj3BE4D+q icJ4k5i+Z+8OZxpQuAStv8B6D62SOoi8sALJpd65QUPfTK/7+TVkscbBYz/BpBv4 74LMkr48LS8TfT8sllNPFnfaLFBavh8pHHTUTxWXdrV3psx5bMqfMFEJy43wGkgv keCW9SDCnWdNqi4iaoiMwN1wjQ1N91+VhgeUhGJ3gesftq5DiQg68Yo7Q37dtxkt 2MJzv3wurorkVRVBTnjj/8twlSG0qFTb9FiE8BLjuFChWuM2J4V2qwDpTA1M838M YnA5fzqZ+uofSpLpM812KtrgJkSF0Me6d9znPNl7La8kF70ahmO+GFJqS68QGS7Y 5FJfWk9BiX6x7U45NSzMYSyLtYeh6Cp/YIOXuramyy0i7HOb3e2xGqqyxxgoy7gd hbrtCveJnTOKyNQBTOSzGtdlAyHAokvz6vpsFwugz4ydMygbXML/UwjCFxpZu0CI P+xmLvtMbpN2ueQhIJcuvhLWTWhUW9Aq+v9LdBi5K+E50z6bSlY= =LrUt -----END PGP SIGNATURE----- --C3KObG+dG5/GCVsd--