Re: Collation versioning
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Michael Paquier <michael@paquier.xyz>, Robert Haas <robertmhaas@gmail.com>, Laurenz Albe <laurenz.albe@cybertec.at>, Douglas Doole <dougdoole@gmail.com>, Christoph Berg <myon@debian.org>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2020-10-22T12:00:07Z
Lists: pgsql-hackers
Attachments
- v31-0001-Remove-pg_collation.collversion.patch (text/x-patch) patch v31-0001
- v31-0002-Add-pg_depend.refobjversion.patch (text/x-patch) patch v31-0002
- v31-0003-Track-collation-versions-for-indexes.patch (text/x-patch) patch v31-0003
- v31-0004-Add-ALTER-INDEX-.-ALTER-COLLATION-.-REFRESH-VERS.patch (text/x-patch) patch v31-0004
- v31-0005-Doc-Add-Collation-Versions-section.patch (text/x-patch) patch v31-0005
On Thu, Sep 24, 2020 at 9:49 PM Julien Rouhaud <rjuju123@gmail.com> wrote: > On Sun, Sep 20, 2020 at 10:24:26AM +0800, Julien Rouhaud wrote: > > On the other hand the *_pattern_ops are entirely hardcoded, and I > > don't think that we'll ever have an extensible way to have this kind > > of magic exception. So maybe having a flag at the am level is > > acceptable? > > Hearing no complaint, I kept the flag at the AM level and added hardcoded > exceptions for the *_pattern_ops opclasses to avoid false positive as much as > possible, and no false negative (at least that I'm aware of). I added many > indexes to the regression tests to make sure that all the cases are correctly > handled. > > Unfortunately, there's still one case that can't be fixed easily. Here's an > example of such case: > > CREATE INDEX ON sometable ((collatable_col || collatable_col) text_pattern_ops) I think we should try to get the basic feature into the tree, and then look at these kinds of subtleties as later improvements. Here's a new version with the following changes: 1. Update the doc patch to mention that this stuff now works on Windows too (see commit 352f6f2d). 2. Drop non_deterministic_only argument for from GetTypeCollations(); it was unused. 3. Drop that "stable collation order" field at the AM level for now. This means that we'll warn you about collation versions changes for hash and bloom indexes, even when it's technically unnecessary, for now. The pattern ops stuff seems straightforward however, so let's keep that bit in the initial commit of the feature. That's a finite set of hard coded op classes which exist specifically to ignore collations.
Commits
-
Doc: Document known problem with Windows collation versions.
- 1bf946bd43e5 14.0 landed
-
Add collation versions for FreeBSD.
- ca051d8b101d 14.0 landed
-
Tolerate version lookup failure for old style Windows locale names.
- 9f12a3b95dd5 14.0 landed
-
Track collation versions for indexes.
- 257836a75585 14.0 landed
-
Add pg_depend.refobjversion.
- cd6f479e79f3 14.0 landed
-
Remove pg_collation.collversion.
- 7d1297df0830 14.0 landed
-
Fix the MSVC build for versions 2015 and later.
- a169155453e3 13.0 cited
-
Add collation versions for Windows.
- 352f6f2df60f 13.0 cited
-
Implement type regcollation
- a2b1faa0f279 13.0 landed
-
Use libc version as a collation version on glibc systems.
- d5ac14f9ccdd 13.0 landed
- 9f90b1d08d79 13.0 landed
-
Make type "name" collation-aware.
- 586b98fdf1aa 12.0 cited