Re: Collation versioning

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, 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-02-12 19:55:06
Message-ID: 60627aa291848f46d96aec51544e191ed6baa1bc.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2020-02-12 at 20:13 +0100, Julien Rouhaud wrote:
> On Wed, Feb 05, 2020 at 05:17:25PM +0100, Julien Rouhaud wrote:
> > Note that I didn't change any syntax (or switched to native functions
> > for the binary pg_dump) as it's still not clear to me what exactly
> > should be implemented.
>
> Hearing no complaints on the suggestions, I'm attaching v8 to address that:
>
> - pg_dump is now using a binary_upgrade_set_index_coll_version() function
> rather than plain DDL
> - the additional DDL is now of the form:
> ALTER INDEX name ALTER COLLATION name REFRESH VERSION
>
> I also added an alternate file for the collate.icu.utf8, so the build farm bot
> should turn green for the linux part.

diff --git a/doc/src/sgml/ref/alter_index.sgml b/doc/src/sgml/ref/alter_index.sgml
index 6d34dbb74e..8661b031e9 100644
--- a/doc/src/sgml/ref/alter_index.sgml
+++ b/doc/src/sgml/ref/alter_index.sgml
@@ -109,6 +110,18 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
</listitem>
</varlistentry>

+ <varlistentry>
+ <term><literal>ALTER COLLATION</literal></term>
+ <listitem>
+ <para>
+ This form update the index existing dependency on a specific collation,
+ to specificy the the currently installed collation version is compatible
+ with the version used the last time the index was built. Be aware that
+ an incorrect use of this form can hide a corruption on the index.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><literal>SET ( <replaceable class="parameter">storage_parameter</replaceable> = <replaceable class="parameter">value</replaceable> [, ... ] )</literal></term>
<listitem>

This description could do with some love. Perhaps:

This command declares that the index is compatible with the currently
installed version of the collations that determine its order. It is used
to silence warnings caused by collation
version incompatibilities and
should be called after rebuilding the index or otherwise verifying its
consistency. Be aware that incorrect use of this command can hide
index corruption.

I didn't study the patch in detail, but do I get it right that there will be no
warnings about version incompatibilities with libc collations?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2020-02-12 19:58:24 Re: Just for fun: Postgres 20?
Previous Message Emre Hasegeli 2020-02-12 19:52:57 Re: In PG12, query with float calculations is slower than PG11