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