Re: Confused comment about drop replica identity index
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, "wangw.fnst@fujitsu.com" <wangw.fnst@fujitsu.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Andres Freund <andres@anarazel.de>
Date: 2021-12-16T23:55:23Z
Lists: pgsql-hackers
On Thu, Dec 16, 2021 at 03:08:46PM -0300, Alvaro Herrera wrote: > 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. Hmm. I have not followed this thread very closely. > 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. The commit logs talk about b23b0f55 here for this code, to ease the handling of relcache entries for rd_replidindex. 07cacba is the origin of the logic (see RelationGetIndexList). Andres? I don't think that this is really an argument against putting more restrictions as anything that deals with an index drop, including the internal ones related to constraints, would need to go through index_drop(), and new features may want more restrictions in place as you say. Now, I don't see a strong argument in changing this behavior either (aka I have not looked at what this implies for the new publication types), and we still need to do something for the comment/docs in existing branches, anyway. So I would still fix this gap as a first step, then deal with the rest on HEAD as necessary. -- Michael
Commits
-
Correct comment and some documentation about REPLICA_IDENTITY_INDEX
- 9edca4cb57d2 10.20 landed
- 1a0ef5e2cc63 11.15 landed
- 861095a40987 12.10 landed
- 28e1e5c2a91c 13.6 landed
- 420f9ac1b77c 14.2 landed
- fc95d35b9429 15.0 landed
-
Add regression tests for REPLICA IDENTITY with dropped indexes
- fe7fd4e9613f 14.0 cited