Re: repack: fix a bug to reject deferrable primary key fallback for concurrent mode - Mailing list pgsql-hackers

From Antonin Houska
Subject Re: repack: fix a bug to reject deferrable primary key fallback for concurrent mode
Date
Msg-id 5990.1776751782@localhost
Whole thread
In response to Re: repack: fix a bug to reject deferrable primary key fallback for concurrent mode  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: repack: fix a bug to reject deferrable primary key fallback for concurrent mode
List pgsql-hackers
Chao Li <li.evan.chao@gmail.com> wrote:

> > On Apr 20, 2026, at 22:52, Antonin Houska <ah@cybertec.at> wrote:
> >
> > I'm just thinking if it's worth a separate error message.
> > RelationGetIndexList() just ignores the deferrable PK
> >
> > if (replident == REPLICA_IDENTITY_DEFAULT && OidIsValid(pkeyIndex) && !pkdeferrable)
> > relation->rd_replidindex = pkeyIndex;
> >
> > and if there's no other suitable index, the result is that there is no
> > identity index for the table. So the change attached here should be consistent
> > with this approach.

> Thanks for your review. I guess you read the v1 patch. In v2, I have switched to use GetRelationIdentityOrPK() that
Zhijiesuggested, which has covered RelationGetIndexList() and all checks, so that code is simplified, and there is no
longera separate error message. 

Yes, this looks like the best approach. Sorry for missing v2.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value)
Next
From: "a.kozhemyakin"
Date:
Subject: Re: Add \pset options for boolean value display