Re: Confused comment about drop replica identity index

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, "wangw(dot)fnst(at)fujitsu(dot)com" <wangw(dot)fnst(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Confused comment about drop replica identity index
Date: 2021-12-16 18:08:46
Message-ID: 202112161808.lxanl3r7skol@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-12-16 18:22:34 Re: Apple's ranlib warns about protocol_openssl.c
Previous Message Alvaro Herrera 2021-12-16 17:54:59 Re: Column Filtering in Logical Replication