Re: Confused comment about drop replica identity index - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Confused comment about drop replica identity index
Date
Msg-id 202112161808.lxanl3r7skol@alvherre.pgsql
Whole thread Raw
In response to Re: Confused comment about drop replica identity index  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Confused comment about drop replica identity index
List pgsql-hackers
On 2021-Dec-15, Michael Paquier wrote:

> On Tue, Dec 14, 2021 at 07:10:49PM +0530, Ashutosh Bapat wrote:
> > This code in RelationGetIndexList() is not according to that comment.
> > 
> >    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;
> 
> Yeah, the comment is wrong.  If the index of a REPLICA_IDENTITY_INDEX
> is dropped, I recall that the behavior is the same as
> REPLICA_IDENTITY_NOTHING.

Hmm, so if a table has REPLICA IDENTITY INDEX and there is a publication
with an explicit column list, then we need to forbid the DROP INDEX for
that index.

I wonder why don't we just forbid DROP INDEX of an index that's been
defined as replica identity.  It seems quite silly an operation to
allow.

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/
"Ed is the standard text editor."
      http://groups.google.com/group/alt.religion.emacs/msg/8d94ddab6a9b0ad3



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Column Filtering in Logical Replication
Next
From: Tom Lane
Date:
Subject: Re: Apple's ranlib warns about protocol_openssl.c