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-29 12:20:28
Message-ID: CA+hUKGLgzE_KOFGnryYACHhaNp8XKCLZYcNFu+J=0rEt702TpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 27, 2020 at 1:34 AM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:
> On Sun, Oct 25, 2020 at 7:13 PM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:
> > I didn't review all the changes yet, so I'll probably post a deeper
> > review tomorrow. I'm not opposed to this new approach, as it indeed
> > saves a lot of code. However, looking at
> > do_collation_version_check(), it seems that you're saving the
> > collation in context->checked_calls even if it didn't raise a WARNING.
> > Since you can now have indexes with dependencies on a same collation
> > with both version tracked and untracked (see for instance
> > icuidx00_val_pattern_where in the regression tests), can't this hide
> > corruption warning reports if the untracked version is found first?
> > That can be easily fixed, so no objection to that approach of course.

Right, fixed.

> I finish looking at the rest of the patches. I don't have much to
> say, it all looks good and I quite like how much useless code you got
> rid of!

Thanks! I tested a bunch of permutations[1] of cross-version
pg_update, with and without ICU, with and without libc version
support, and fixed some problems I found in pg_dump:

1. We need to print OIDs as %u, not %d. Also, let's use
'%u'::pg_catalog.oid to be consistent with nearby things.

2. We dump binary_upgrade_set_index_coll_version(<index>, NULL, ...)
to blow away the new cluster's versions before we import the old
versions. OK, but the function was marked STRICT...

3. We dump binary_upgrade_set_index_coll_version(<index>,
<collation>, <version>), to import the old cluster's version, where
<collation> is an OID. OK, but we need the new cluster's OID, not the
old one, so it needs to be an expression like
'pg_catalog."fr_FR"'::regcollation (compare the other references to
collations in the dump, which are all by name).

4. I didn't really like the use of '' for unknown. I figured out how
to use NULL for that.

[1] https://github.com/macdice/some_pg_upgrade_tests

Attachment Content-Type Size
v33-0001-Remove-pg_collation.collversion.patch text/x-patch 27.7 KB
v33-0002-Add-pg_depend.refobjversion.patch text/x-patch 12.2 KB
v33-0003-Track-collation-versions-for-indexes.patch text/x-patch 116.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2020-10-29 12:54:07 Re: document pg_settings view doesn't display custom options
Previous Message Amit Kapila 2020-10-29 12:20:20 Re: [HACKERS] logical decoding of two-phase transactions