On Tue, Oct 10, 2023 at 8:29 PM Noah Misch <n...@leadboat.com> wrote: > My friend got an amcheck "lacks matching index tuple" failure, and they asked > me about it. I ran into the assertion failure while reproducing things.
Reminds me of the time that amcheck found a bug in the default btree opclass for PostGIS's geography type. The opclass wasn't really intended to be used for indexing. The issue with the opclass (which violated transitive consistency) would probably never have been detected were it not for the tendency of PostGIS users to accidentally create useless B-Tree indexes on geography columns. Users sometimes omitted "using gist", without necessarily noticing that the index was practically useless. > > Do we really need to change the catalog contents when backpatching? > > Not really. I think we usually do. On the other hand, unlike some past > cases, there's no functional need for the catalog changes. The catalog > changes just get a bit of efficiency. No strong preference here. I'll defer to you on this question, then. I don't see any reason to delay committing your fix. The issue that you've highlighted is exactly the kind of issue that I anticipated might happen at some point. This seems straightforward. -- Peter Geoghegan