Re: Create collation reporting the ICU locale display name

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
Cc: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Michael Paquier" <michael(at)paquier(dot)xyz>, "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Create collation reporting the ICU locale display name
Date: 2019-09-14 15:13:13
Message-ID: 23477.1568473993@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Daniel Verite" <daniel(at)manitou-mail(dot)org> writes:
> Tom Lane wrote:
>> I think that's a useful function, but it's a different function from
>> the one first proposed, which was to tell you the properties of a
>> collation you already installed (which might not be ICU, even).
>> Perhaps we should have both.

> The pre-create use case would look like:
> SELECT * FROM describe_collation(locale_string text, collprovider "char")

> Post-creation, one could do:
> SELECT * FROM describe_collation(collcollate, collprovider)
> FROM pg_catalog.pg_collation WHERE oid = :OID;

> Possibly it could exists as SELECT * FROM describe_collation(oid)
> but that's essentially the same function.

The advantage of describe_collation(oid) is that we would not be
building knowledge into the callers about which columns of pg_collation
matter for this purpose. I'm not even convinced that the two you posit
here are sufficient --- the encoding seems relevant, for instance.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2019-09-14 15:42:53 Re: Add "password_protocol" connection parameter to libpq
Previous Message Tom Lane 2019-09-14 15:08:06 Re: [PATCH] Improve performance of NOTIFY over many databases (v2)