[Bug 965340] New: Change default locale for postgresql to UTF-8
http://bugzilla.opensuse.org/show_bug.cgi?id=965340 Bug ID: 965340 Summary: Change default locale for postgresql to UTF-8 Classification: openSUSE Product: openSUSE Tumbleweed Version: 2015* Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: max@suse.com Reporter: mrueckert@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- just changing the POSTGRES_LANG or the in script default to UTF-8 would fix that. we have default locales for other things in the postgresql.conf also set to UTF-8 and this would make it more consistent. also with the current defaults you cant create UTF-8 based DBs from template1 but have to use template0. so you would need to maintain 2 templates based on the encoding. with current defaults: ``` psql (PostgreSQL) 9.4.5 List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+-----------+---------+-------+----------------------- postgres | postgres | SQL_ASCII | C | C | template0 | postgres | SQL_ASCII | C | C | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | SQL_ASCII | C | C | =c/postgres + | | | | | postgres=CTc/postgres (3 rows) ``` with the default locale changed to en_US.UTF-8 (i just set POSTGRES_LANG for testing) ``` psql --version ; psql -l psql (PostgreSQL) 9.4.5 List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres (3 rows) ``` Thoughts? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=965340
http://bugzilla.opensuse.org/show_bug.cgi?id=965340#c1
Reinhard Max
http://bugzilla.opensuse.org/show_bug.cgi?id=965340
http://bugzilla.opensuse.org/show_bug.cgi?id=965340#c2
Jörg Sonnenberger
I think the default is reasonable as it is, because:
--- snip (/etc/sysconfig/postgresql) --- # If unset or empty $RC_LANG from /etc/sysconfig/language is used. POSTGRES_LANG="" --- snap ---
So, if you get SQL_ASCII you should check your system locale.
I don't agree with the choice here. There are quite a few good reasons for wanting to use C as locale since it is significantly faster for comparison operations. At the same time, SQL_ASCII goes back to the single byte encodings, which is not what a user would expect nowadays. Always using "-E unicode" seems to far better fit expectations as default. If anything, it might make sense to have a separate variable for that, but the default in the 21st century clearly should go towards unicode. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=965340
http://bugzilla.opensuse.org/show_bug.cgi?id=965340#c3
--- Comment #3 from Marcus Rückert
http://bugzilla.opensuse.org/show_bug.cgi?id=965340
http://bugzilla.opensuse.org/show_bug.cgi?id=965340#c4
--- Comment #4 from Reinhard Max
so the rest of the system *is* using that locale even if nothing is set in /etc/sysconfig/language.
/etc/sysconfig/language used to be the location that defines the system locale. In case that has changed between 42.1 and current Tumbleweed I might have to fix PostgreSQL to properly pick it up again, but I don't think it makes sense to set a different default locale for PostgreSQL than the system locale.
also during the discussion it was pointed out that using encoding UTF-8 but leaving collate/ctype at C might actually be faster.
What discussion? -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com