Re: Collation versioning

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Douglas Doole <dougdoole(at)gmail(dot)com>, Christoph Berg <myon(at)debian(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Collation versioning
Date: 2020-10-22 12:00:07
Message-ID: CA+hUKGKHj4aYmmwKZdZjkD=CWRmn=e6UsS7S+u6oLrrp0orgsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 24, 2020 at 9:49 PM Julien Rouhaud <rjuju123(at)gmail(dot)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.

Attachment Content-Type Size
v31-0001-Remove-pg_collation.collversion.patch text/x-patch 27.6 KB
v31-0002-Add-pg_depend.refobjversion.patch text/x-patch 12.3 KB
v31-0003-Track-collation-versions-for-indexes.patch text/x-patch 109.6 KB
v31-0004-Add-ALTER-INDEX-.-ALTER-COLLATION-.-REFRESH-VERS.patch text/x-patch 14.8 KB
v31-0005-Doc-Add-Collation-Versions-section.patch text/x-patch 2.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anastasia Lubennikova 2020-10-22 12:11:45 Re: [patch] Fix checksum verification in base backups for zero page headers
Previous Message Heikki Linnakangas 2020-10-22 11:48:21 Re: Polyphase merge is obsolete