Re: Create collation reporting the ICU locale display name

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-13 14:59:20
Message-ID: CA+TgmoZUBaKyL-78eVnA5qiX4WoR8v+CHKAt5PBCmQeXo_ZLkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 13, 2019 at 9:57 AM Daniel Verite <daniel(at)manitou-mail(dot)org> wrote:
> An advantage of this approach is that you may execute the
> function before creating the collation, instead of creating the
> collation, realizing there was something wrong in your
> locale/lc_collate argument, dropping the collation and trying again.

That would be really nice.

I also think that the documentation is entirely inadequate in this
area. https://www.postgresql.org/docs/11/collation.html#COLLATION-CREATE
gives some examples, but those don't help you understand the general
principles very much, and it has some links to the ICU documentation,
which helps less than one might think. For example it links to
http://userguide.icu-project.org/locale which describes locales like
en_IE(at)currency=IEP and es__TRADITIONAL, but if you can figure out what
all the valid possibilities are by reading that page, you are much
smarter than me. Then, too, according to the PostgreSQL documentation
you ought to prefer forms using the newer syntax, which looks like a
bunch of dash-separated things, e.g. de-u-co-phonebk. But neither the
PostgreSQL documentation itself nor either of the links to ICU
included there actually describe the rules for that syntax. They just
say things like 'use BCP-47', which doesn't help at all. So I am just
reduced to trying a bunch of things and seeing which collations appear
to behave differently when I use them.

This proposal wouldn't fix the problem that I have to guess what
strings to use, but at least it might be clearer when I have or have
not guessed correctly.

I seriously hate this stuff with a fiery passion that cannot be
quenched. How does anybody manage to use software that seems to have
no usable documentation and doesn't even tell whether or not you
supplied it with input that it thinks is valid?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-09-13 15:09:52 Re: Create collation reporting the ICU locale display name
Previous Message Tomas Vondra 2019-09-13 14:57:34 Re: logical decoding : exceeded maxAllocatedDescs for .spill files