Re: Add standard collation UNICODE

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Peter Eisentraut" <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add standard collation UNICODE
Date: 2023-04-27 11:44:55
Message-ID: 49417853-7bdd-4b23-a4e9-04c7aff33821@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:

> COLLATE UNICODE
>
> instead of
>
> COLLATE "und-x-icu"
>
> or whatever it is, is pretty useful.
>
> So, attached is a small patch to add this.

This collation has an empty pg_collation.collversion column, instead
of being set to the same value as "und-x-icu" to track its version.

postgres=# select * from pg_collation where collname='unicode' \gx
-[ RECORD 1 ]-------+--------
oid | 963
collname | unicode
collnamespace | 11
collowner | 10
collprovider | i
collisdeterministic | t
collencoding | -1
collcollate |
collctype |
colliculocale | und
collicurules |
collversion |

The original patch implements this as an INSERT in which it would be easy to
fix I guess, but in current HEAD it comes as an entry in
include/catalog/pg_collation.dat:

{ oid => '963',
descr => 'sorts using the Unicode Collation Algorithm with default
settings',
collname => 'unicode', collprovider => 'i', collencoding => '-1',
colliculocale => 'und' },

Should it be converted back into an INSERT or better left
in this file and collversion being updated afterwards?

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2023-04-27 12:10:00 Re: Should vacuum process config file reload more often
Previous Message Denis Laxalde 2023-04-27 11:06:27 Re: Add PQsendSyncMessage() to libpq