Re: [HACKERS] CREATE COLLATION does not sanitize ICU's BCP 47language tags. Should it? - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: [HACKERS] CREATE COLLATION does not sanitize ICU's BCP 47language tags. Should it?
Date
Msg-id CAH2-Wzk2V2R8eE1jMyacioUifdnfeoWrayFUyzY=azX0H-ZqDw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] CREATE COLLATION does not sanitize ICU's BCP 47language tags. Should it?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] CREATE COLLATION does not sanitize ICU's BCP 47language tags. Should it?
List pgsql-hackers
On Wed, Sep 20, 2017 at 4:04 PM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> ICU <54 doesn't even support the BCP 47 style, so we need to keep
> supporting the old/other style anyway.

Yes it does -- just not as a native locale name. ucol_open()
apparently became more liberal in what it would accept in ICU 54.

>> And, I think that I
>> see a bigger problem: we pass a string that is almost certainly a BCP
>> 47 string to ucol_open() from within pg_newlocale_from_collation(). We
>> do so despite the fact that ucol_open() apparently doesn't accept BCP
>> 47 syntax locale strings until ICU 54 [1].
>
> pg_import_system_collations() takes care to use the non-BCP-47 style for
> such versions, so I think this is working correctly.

But CREATE COLLATION doesn't use pg_import_system_collations().

-- 
Peter Geoghegan


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Darafei "Komяpa" Praliaskouski
Date:
Subject: Re: [HACKERS] compress method for spgist - 2
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] [Proposal] Allow users to specify multiple tables in VACUUM commands