Jeff Davis wrote:
> I have attached a patch 0001 that
> fixes a misleading hint, but it's still not great.
+1 for the patch
> When using ICU or the builtin provider, it still requires coming up
> with some valid locale name for LC_COLLATE and LC_CTYPE
No, since the following invocation does work:
CREATE DATABASE test
template='template0'
locale_provider='builtin'
builtin_locale='C.UTF-8';
Here we let 'locale' or 'lc_collate/lc_ctype' which is the same thing,
defaulting from the template database.
In the discussion you mentioned, the error comes from the OP using
'locale' instead of 'builtin_locale'. At least that's my understanding.
This mistake is not surprising, because when you specify a locale
provider followed by a locale, intuitively you'd expect this locale
to refer to that locale provider. Yet that's not case, mostly for backward
compatibility reasons.
> * Force the environment variables LC_COLLATE=C and LC_CTYPE=C
> unconditionally, and pg_perm_setlocale() them
Currently that would be a regression for some people, because
when LC_CTYPE=C, the FTS parser produces substandard results with
characters beyond ASCII.
Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/