Re: CREATE DATABASE command for non-libc providers
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Jeff Davis" <pgsql@j-davis.com>
Cc: pgsql-hackers@postgresql.org
Date: 2025-06-06T20:03:07Z
Lists: 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/
Commits
-
Improve CREATE DATABASE error message for invalid libc locale.
- 5b40feab594c 18.0 landed
-
Fix support of digits in email/hostnames.
- 61d66c44f18c 9.6.0 cited
-
Modify the built-in text search parser to handle URLs more nearly according
- 2c265adea312 9.0.0 cited