Re: Bogus collation version recording in recordMultipleDependencies
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, Julien Rouhaud <rjuju123@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-04-19T19:38:27Z
Lists: pgsql-hackers
On Mon, Apr 19, 2021 at 11:49 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > I didn't mean to imply that it's necessarily theoretically impossible, > but given our lack of visibility into what a function or operator > will do, plus the way that the collation feature was bolted on > with minimal system-level redesign, it's sure pretty darn hard. > Code like record_eq is doing a lot at runtime that we can't really > see from static analysis. It's worth pointing out that code like record_eq is not (or at least should not be) fundamentally unpredictable and unruly. The fact that record_eq does typecache lookups and whatnot seems to me to be an implementation detail. What record_eq is entitled to assume about collations could be formalized by some general high-level specification. It ought to be possible to do this, just as it ought to be possible for us to statically determine if a composite type is safe to use with B-Tree deduplication. Whether or not it's worth the trouble is another matter, but it might be if a single effort solved a bunch of related problems, not just the collation dependency problem. > Anyway, given the ALTER TYPE ADD ATTRIBUTE counterexample, I'm > definitely starting to lean towards "revert and try again in v15". The counterexample concerns me because it seems to indicate a lack of sophistication in how dependencies are managed with corner cases -- I don't think that it's okay to leave the behavior unspecified in a stable release. But I also think that we should consider if code like record_eq is in fact the real problem (or just the lack of any general specification that constrains code like it in useful ways, perhaps). This probably won't affect whether or not the patch gets reverted now, but it still matters. -- Peter Geoghegan
Commits
-
Doc: Update notes about libc collation versions.
- b65431ca5e12 14.0 landed
-
Revert per-index collation version tracking feature.
- ec4831470826 14.0 landed
-
Rethink extraction of collation dependencies.
- f24b15699705 14.0 landed
-
Fix bogus collation-version-recording logic.
- ef387bed87f2 14.0 landed
-
Rename the "point is strictly above/below point" comparison operators.
- 0cc993278888 14.0 cited
-
Move catalog toast table declarations
- b4c9695e79f7 14.0 cited