On 09/19/2017 12:46 AM, Peter Geoghegan wrote:> At one point a couple of
months back, it was understood that
get_icu_language_tag() might not always work with (assumed) valid
locale names -- that is at least the impression that the commit
message of eccead9 left me with. But, that was only with ICU 4.2, and
in any case we've since stopped creating keyword variants at initdb
time for other reasons (see 2bfd1b1 for details of those other
reasons). I tend to think that we should not install any language tag
that uloc_toLanguageTag() does not accept as valid on general
principle (so not just at initdb time, when it's actually least
needed).
Thoughts? I can write a patch for this, if that helps. It should be
straightforward.
Hm, I like the idea but I see some issues.
Enforcing the BCP47 seems like a good thing to me. I do not see any
reason to allow input with syntax errors. The issue though is that we do
not want to break people's databases when they upgrade to PostgreSQL 11.
What if they have specified the locale in the old non-ICU format or they
have a bogus value and we then error out on pg_upgrade or pg_restore?
Andreas
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers