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 1jZFoq-0001mI-2Q for pgsql-docs@arkaria.postgresql.org; Thu, 14 May 2020 15:30:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jZFop-00007N-0M for pgsql-docs@arkaria.postgresql.org; Thu, 14 May 2020 15:30:43 +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 1jZFoo-0008Ri-Lp for pgsql-docs@lists.postgresql.org; Thu, 14 May 2020 15:30:42 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jZFol-0008Va-Ry for pgsql-docs@postgresql.org; Thu, 14 May 2020 15:30:42 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 5C27421C4144; Thu, 14 May 2020 18:30:38 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail.postgrespro.ru (unknown [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 35F6121C236F; Thu, 14 May 2020 18:30:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1589470238; bh=PwMjil8F1ktZignS4Fq5IhJYP/6wSMh79DpODWK7uo4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=fDvWZwVz0wvUYfNrxHMCz7y/Zqv2n8wX1qMxANmTUzg1eUvQpDGyCSkg03I1WtZIe zXOzO48Dj/YwY2Y7yrcpParh75CjMjj2/sURA/Gv3JIQlp/3QUonHWI4P309KsTIvJ KMx6XuaQUEXD7IAwYqBwa6nJnrK04iMJWnx7FpBk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 14 May 2020 18:30:38 +0300 From: Marina Polyakova To: Michael Paquier Cc: daniel@yesql.se, a.lakhin@postgrespro.ru, pgsql-docs@postgresql.org Subject: Re: Missing comma? In-Reply-To: <20200514000738.GA166343@paquier.xyz> References: <5B3957FE-D31E-4838-B35C-C2F0EEC3E557@yesql.se> <6fa8ba75057b16f88010c2b945f720c0@postgrespro.ru> <20200514000738.GA166343@paquier.xyz> User-Agent: Roundcube Webmail/1.4.0 Message-ID: <226cae2ef0bf26a59011de38eec9c7f4@postgrespro.ru> X-Sender: m.polyakova@postgrespro.ru Organization: Postgres Professional List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-05-14 03:07, Michael Paquier wrote: > On Wed, May 13, 2020 at 05:17:43PM +0300, Marina Polyakova wrote: >> in my opinion it's a little unclear what "or default" means at the >> end, >> because the comma is used to separate enumeration elements ("d = >> default >> <...>, n = nothing, f = all columns, i = index <...>") and inside the >> element description ("i = index with indisreplident set, or default"). >> Therefore here is an additional patch from me to clarify this place, >> thanks >> to Alexander Lakhin for help. > > Yes, I agree that this last "or default" in the docs does not make > much sense, because we always enforce REPLICA_IDENTITY_NOTHING if > there is no replica identity. This looks like a shortened version of a comment from src/include/catalog/pg_class.h: /* * 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'. */ #define REPLICA_IDENTITY_INDEX 'i' >> diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml >> index >> 02ddebae99d98110a8dd290dd4cb0c980adf7984..034a08f80ea4269f131e7e1383ba482fd76d9344 >> 100644 >> --- a/doc/src/sgml/catalogs.sgml >> +++ b/doc/src/sgml/catalogs.sgml >> @@ -1936,7 +1936,7 @@ SCRAM-SHA-256$<iteration >> count>:&l >> d = default (primary key, if any), >> n = nothing, >> f = all columns, >> - i = index with >> indisreplident set, or default >> + i = index with >> indisreplident set (if any) >> >> > > And you don't need the ("if any") either here, no? > REPLICA_IDENTITY_INDEX means that we have an index associated with the > replica identity so it seems to me that this last part can just be > removed. I tried to save information for cases when the index is dropped as in the code comment (see above) and the function RelationGetIndexList (where IIUC we check if this index exists): if (replident == REPLICA_IDENTITY_DEFAULT && OidIsValid(pkeyIndex)) relation->rd_replidindex = pkeyIndex; else if (replident == REPLICA_IDENTITY_INDEX && OidIsValid(candidateIndex)) relation->rd_replidindex = candidateIndex; else relation->rd_replidindex = InvalidOid; Perhaps it will be useful for some users to know that relreplident = i does not mean that the required index exists (as in default case)?.. -- Marina Polyakova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company