Search Postgresql Archives

Re: How to find correct locale name for CREATEDATABASE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In Fedora    et_EE.UTF8
Other linuxes    et_EE.UTF-8
These are the same locales, just a differently named encoding.

Postgres requires those suffixes in locale names.
They must me exactly UTF8 or UTF-8 or 1257 .
If those are missing, or even if - sign is missed in UTF-8, error occurs on

create database test lc_collate '...'

So all those invariants must be used in probing.

What do you need the locale for in your case?

I need locale mostly for ILIKE  and  ORDER BY  to work properly.

Collation?

Yes.

Monetary values?

No

Numeric representation?

No

Or just for encoding - which isn't part of the locale AFAIK?
For this reason I'm looking for a way to probe server for locale existence.


I'm thinking you may be able to use your clients settings to determine the right locale from the database's session variables. You can, for example, "set lc_ctype to 'et_EE';" and verify that you get the same locale back.

set lc_ctype to 'et_EE'

or to other value returns

parameter "lc_ctype" cannot be changed

Or you could perform a simple test-query that should return a row encoded in the encoding you need and verify that it matches what you expect.

I need to know locale name to set locale.
Is there some simple command which can used to test for locale existence for create database command ?

Andrus.

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux