pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feeddatabase locale and system locale
6+ messages / 3 participants
[nested] [flat]
* database locale and system locale
@ 2006-03-26 05:22 Erwin Brandstetter <brandstetter@falter.at>
0 siblings, 1 reply; 6+ messages in thread
From: Erwin Brandstetter @ 2006-03-26 05:22 UTC (permalink / raw)
To: pgsql-admin
Hi everyone!
I've been reading tons of stuff on locale and postgresql. I am still not
in the clear about some details, though: how do system locale and
database locale work together (or not)?
(In my case, I am speaking of postgresql 8.1 on debian sarge. But
general understanding is what I am looking for.)
If I am running a database cluster with --encoding= UTF8, are there any
troubles to be expected if the system locale remains "C" or somehting
like "de_AT.iso885915@euro"?
Any troubles with error messages, dumps, hacking the dump, performance?
Any trouble at all?
Is it enough to have an UTF8 locale installed on the system?
postgres@dbneu:~$ locale -a
C
de_AT.utf8@euro
Or does it actually have to be the system locale?
postgres@dbneu:~$ locale
LC_ALL="de_AT.UTF-8@euro"
Do multiple UTF8 system locales have any effect?
postgres@dbneu:~$ locale -a
C
de_AT.utf8@euro
en_US.utf8
Does anyone know these details? It would ease my mind. :)
Thanx in advance!
Regards
Erwin Brandstetter
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database locale and system locale
@ 2006-03-26 08:24 Peter Eisentraut <peter_e@gmx.net>
parent: Erwin Brandstetter <brandstetter@falter.at>
0 siblings, 1 reply; 6+ messages in thread
From: Peter Eisentraut @ 2006-03-26 08:24 UTC (permalink / raw)
To: pgsql-admin; +Cc: Erwin Brandstetter <brandstetter@falter.at>
Erwin Brandstetter wrote:
> I've been reading tons of stuff on locale and postgresql. I am still
> not in the clear about some details, though: how do system locale and
> database locale work together (or not)?
The system locale is more or less ignored. What matters are the locales
set in the database.
> If I am running a database cluster with --encoding= UTF8, are there
> any troubles to be expected if the system locale remains "C" or
> somehting like "de_AT.iso885915@euro"?
Your sort order will approach randomness.
> Is it enough to have an UTF8 locale installed on the system?
You need to have it installed and you need to tell initdb to use it.
> Or does it actually have to be the system locale?
No.
> Do multiple UTF8 system locales have any effect?
No.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database locale and system locale
@ 2006-03-26 09:16 Erwin Brandstetter <brandstetter@falter.at>
parent: Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 6+ messages in thread
From: Erwin Brandstetter @ 2006-03-26 09:16 UTC (permalink / raw)
To: pgsql-admin; +Cc: peter_e@gmx.net
peter_e@gmx.net wrote:
> Erwin Brandstetter wrote:
>
>> I've been reading tons of stuff on locale and postgresql. I am still
>> not in the clear about some details, though: how do system locale and
>> database locale work together (or not)?
>>
>
> The system locale is more or less ignored. What matters are the locales
> set in the database.
>
Great!
>
>> If I am running a database cluster with --encoding= UTF8, are there
>> any troubles to be expected if the system locale remains "C" or
>> somehting like "de_AT.iso885915@euro"?
>>
>
> Your sort order will approach randomness.
>
(...)
Wait .. not that great! The system locale is more or less ignored, but
my sort order will approach randomness?
Can you or anyone shed some more light on this? I am even more confused
than I was before ..
Regards
Erwin Brandstetter
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database locale and system locale
@ 2006-03-26 16:20 Tom Lane <tgl@sss.pgh.pa.us>
parent: Erwin Brandstetter <brandstetter@falter.at>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2006-03-26 16:20 UTC (permalink / raw)
To: Erwin Brandstetter <brandstetter@falter.at>; +Cc: pgsql-admin; peter_e@gmx.net
Erwin Brandstetter <brandstetter@falter.at> writes:
> Wait .. not that great! The system locale is more or less ignored, but
> my sort order will approach randomness?
Peter's point is that a given locale setting will expect a particular
encoding, and if you try to use a different encoding then your sort
ordering will be wrong. Not "random" exactly, but not what you want.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database locale and system locale
@ 2006-03-27 08:56 Erwin Brandstetter <brandstetter@falter.at>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Erwin Brandstetter @ 2006-03-27 08:56 UTC (permalink / raw)
To: pgsql-admin; +Cc: tgl@sss.pgh.pa.us
tgl@sss.pgh.pa.us wrote:
> Erwin Brandstetter <brandstetter@falter.at> writes:
>
>> Wait .. not that great! The system locale is more or less ignored, but
>> my sort order will approach randomness?
>>
>
> Peter's point is that a given locale setting will expect a particular
> encoding, and if you try to use a different encoding then your sort
> ordering will be wrong. Not "random" exactly, but not what you want.
Sorry, maybe I am slow in the head. Are you referring to the system
locale of the client OS?
My question was aiming at the database server OS. (Maybe I have not been
clear enough myself.)
Example:
~~~~~~~
Postgresql --encoding=UTF8 --locale='de_AT.UTF-8@euro'
Server OS: (Debian Sarge) set system locale 'C' (locale
'de_AT.UTF-8@euro' is installed, too)
PHP5, Apache.
Client: Browser (Mozilla Firefox in our case) on various OS´s (Mac, Win,
Linux), set to work with UNICODE data.
Would the system locale of the _server_ OS mess with the sort order? (Or
with anything at all?)
Any sorting done on the client would be based on the _client_ OS system
locale, but that is a different question ..
Regards
Erwin Brandstetter
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database locale and system locale
@ 2006-03-27 12:33 Peter Eisentraut <peter_e@gmx.net>
parent: Erwin Brandstetter <brandstetter@falter.at>
0 siblings, 0 replies; 6+ messages in thread
From: Peter Eisentraut @ 2006-03-27 12:33 UTC (permalink / raw)
To: pgsql-admin; +Cc: Erwin Brandstetter <brandstetter@falter.at>
Am Montag, 27. März 2006 10:56 schrieb Erwin Brandstetter:
> Would the system locale of the _server_ OS mess with the sort order? (Or
> with anything at all?)
No.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2006-03-27 12:33 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-26 05:22 database locale and system locale Erwin Brandstetter <brandstetter@falter.at>
2006-03-26 08:24 ` Peter Eisentraut <peter_e@gmx.net>
2006-03-26 09:16 ` Erwin Brandstetter <brandstetter@falter.at>
2006-03-26 16:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-03-27 08:56 ` Erwin Brandstetter <brandstetter@falter.at>
2006-03-27 12:33 ` Peter Eisentraut <peter_e@gmx.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox