Hi,
I've written a small function that should go into contrib for 7.1
As locale issues are quite tricky, being able to find out what locale
backend thinks it is in is a good thing ;)
from my README.getlocale:
getlocale('category')
---------------------
return the locale setting of the backend
(see '> man setlocale for definitions)
If category is one of LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY,
LC_NUMERIC, LC_TIME the corresponding setting is returned.
[hannu@taru contrib]$ psql -c "select getlocale('LC_COLLATE')"
getlocale
-----------
en_US
(1 row)
for LC_ALL (and anything else) a string like the following is returned
[hannu@taru getlocale]$ psql -c "select getlocale('*')"
getlocale
----------------------------------------------------------------------------------------
LC_CTYPE=en_US;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=en_US;LC_MONETARY=en_US;LC_MESSAGES=C
(1 row)
IMHO some form of it should end up in the main distribution, probably by
7.2.
---------------------------------
Hannu Krosing <hannu@krosing.net>