FS#16481 - Bad defaults: PostgreSQL defaults to C locale because Arch overrides LC_COLLATE
Attached to Project:
Arch Linux
Opened by Marti (intgr) - Tuesday, 06 October 2009, 13:33 GMT
Last edited by Roman Kyrylych (Romashka) - Tuesday, 06 October 2009, 13:44 GMT
Opened by Marti (intgr) - Tuesday, 06 October 2009, 13:33 GMT
Last edited by Roman Kyrylych (Romashka) - Tuesday, 06 October 2009, 13:44 GMT
|
Details
Description:
On most distributions, PostgreSQL defaults to UTF-8 encoding, as they have the LOCALE or LANG environment variable set with an UTF-8 locale. Most users expect recent database engines to "just work" with Unicode data without any special configuration. On Arch Linux, however, even if the user has LOCALE=en_US.UTF-8 set in their rc.conf, PostgreSQL gets initialized with a C locale because it relies on LC_COLLATE. Arch's default /etc/profile overrides LC_COLLATE=C Personally I think this is a good override, but it just doesn't play nice with PostgreSQL. Thus I suggest changing initdb in /etc/rc.d/postgresql to use the user's preferred LOCALE: - su - postgres -c "/usr/bin/initdb -D $PGROOT/data" + su - postgres -c "/usr/bin/initdb -D $PGROOT/data --locale $LOCALE" (See also: related bug Steps to reproduce: # grep ^LOCALE /etc/rc.conf LOCALE="en_US.UTF-8" # grep ^LC_COLLATE /etc/profile LC_COLLATE="C" # pacman -S postgresql ... # /etc/rc.d/postgresql start :: Starting PostgreSQL [BUSY] ... The database cluster will be initialized with locale C. The default database encoding has accordingly been set to SQL_ASCII. ... |
This task depends upon
Closed by Roman Kyrylych (Romashka)
Tuesday, 06 October 2009, 13:44 GMT
Reason for closing: Won't fix
Additional comments about closing: the proposed fix is obsoleted by a proper fix
Tuesday, 06 October 2009, 13:44 GMT
Reason for closing: Won't fix
Additional comments about closing: the proposed fix is obsoleted by a proper fix
FS#15250.