Re: CREATE DATABASE command for non-libc providers - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: CREATE DATABASE command for non-libc providers
Date
Msg-id 73959a14-267b-49c1-8293-291b175682cb@manitou-mail.org
Whole thread Raw
In response to CREATE DATABASE command for non-libc providers  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: CREATE DATABASE command for non-libc providers
List pgsql-hackers
    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/



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Non-reproducible AIO failure
Next
From: Nico Williams
Date:
Subject: Re: Unnecessary connection overhead due copy-on-write (mainly openssl)