pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: postgresql encoding/locale issues
jperkin%mnx.io@localhost (Jonathan Perkin) writes:
>* On 2023-04-14 at 13:39 BST, Greg Troxel wrote:
>>If I remove LANG and LC_ALL, but leave LC_CTYPE, postgresql starts and
>>creates a database.
>This has been my understanding for many years - LANG and LC_ALL should
>not be set, but instead use LC_CTYPE to specify the general locale you
>wish to use (en_GB.UTF-8 for me), and then other LC_* as appropriate.
>In particular you likely do not want LC_COLLATE to default to whatever
>you set LANG to, as the only sane sort order is LC_COLLATE=C.
LANG is the default, that gets overridden by LC_* for specific
categories.
LC_ALL overrides everything, so that's mostly used to turn off locale
support for specific commands (e.g. LC_ALL=C awk ...).
Postgresql uses LC_CTYPE and LC_COLLATE.
Unfortunately we do not support LC_COLLATE (other than "C"), so any
setting to a different value (i.e. via LANG or LC_ALL or LC_COLLATE)
makes Postgres fail.
Setting LANG and overriding LC_COLLATE with "C" works.
Home |
Main Index |
Thread Index |
Old Index