Обсуждение: Is there an answer to the Ultimate Question for PostgreSQL?

Поиск
Список
Период
Сортировка

Is there an answer to the Ultimate Question for PostgreSQL?

От
Gregory Kotsaftis
Дата:
Let's assume someone would wish to create an application to be used by many different users from different countries, simultaneously.
The data should be stored within the same database and shared among all users and also, each user should be able to execute upper(), lower(), order by, etc. properly for his locale.

Is PostgreSQL up to the task? Sure we could use UTF8 for the database encoding, but what can be done about the different locales?
Any thoughts?

Greg

Re: Is there an answer to the Ultimate Question for PostgreSQL?

От
Tom Lane
Дата:
Gregory Kotsaftis <gregkotsaftis@yahoo.com> writes:
> Let's assume someone would wish to create an application to be used by many different users from different countries,
simultaneously.
> The data should be stored within the same database and shared among all users and also, each user should be able to
executeupper(), lower(), order by, etc. properly for his locale. 

> Is PostgreSQL up to the task? Sure we could use UTF8 for the database encoding, but what can be done about the
differentlocales? 

See the COLLATE feature in 9.1 and later.

            regards, tom lane

Re: Is there an answer to the Ultimate Question for PostgreSQL?

От
Gregory Kotsaftis
Дата:
Do you mean we should create a db with a specific COLLATE and then depending on the user's locale we should change the queries?
for example like this:
SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR";

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gregory Kotsaftis <gregkotsaftis@yahoo.com>
Cc: "pgsql-novice@postgresql.org" <pgsql-novice@postgresql.org>
Sent: Thursday, July 26, 2012 12:53 AM
Subject: Re: [NOVICE] Is there an answer to the Ultimate Question for PostgreSQL?

Gregory Kotsaftis <gregkotsaftis@yahoo.com> writes:
> Let's assume someone would wish to create an application to be used by many different users from different countries, simultaneously.
> The data should be stored within the same database and shared among all users and also, each user should be able to execute upper(), lower(), order by, etc. properly for his locale.

> Is PostgreSQL up to the task? Sure we could use UTF8 for the database encoding, but what can be done about the different locales?

See the COLLATE feature in 9.1 and later.

            regards, tom lane


Re: Is there an answer to the Ultimate Question for PostgreSQL?

От
Tom Lane
Дата:
Gregory Kotsaftis <gregkotsaftis@yahoo.com> writes:
> Do you mean we should create a db with a specific COLLATE and then depending on the user's locale we should change
thequeries? 
> for example like this:

> SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR";

Yeah.  You might also find that labeling particular table columns with
collations is useful.

            regards, tom lane