views:

246

answers:

1

I know that database locales on Postgres are responsible for proper order of national characters, proper lower/upper-casing etc.

But why there are two language-neutral locales: posix and c? Is there any difference between them or is it just one neutral locale with two different names?

UPDATE As Magnus Hagander states in his answer, POSIX and C locales are the same locale with different names (no mather if Postgres is installed on POSIX or Windows System). I don't know how to confirm this information - where to look for proper section of documentation?

Magnus's explanation seems sensible, but it is strange at the same time that there are two names for the same locale to choose from. What is the purpose of this - only to make confusion?

+4  A: 

Note that PostgreSQL just uses the operating system locale, and doesn't have it's own definition of locales. If your system is POSIX compliant, C and POSIX will be the exact same locale: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html (see the first sentence under 7.2).

Magnus Hagander
OK, if Postgres is installed on POSIX compliant system than POSIX locale is the same as C locale. But what with non-compliant systems? Is Windows Vista POSIX-compliant? I've Vista box with Postgres and I'm always not sure what to choose POSIX or C - as this two options are both possible (among many other national-specific locales). Where should I find info about POSIX and C locales - what this means (differences) on Windows Vista?
WildWezyr
The C locale should work the same way on Windows. I'm unsure if the POSIX locale even exists, but if it does I'd expect it to work the same way - it'd be stupid of them to implement a locale named POSIX and not make it POSIX compatible.
Magnus Hagander