Обсуждение: Internationalization

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

Internationalization

От
CS DBA
Дата:
Hi All;

we want to store data in a generic fashion (COLLATION / ENCODING?)

and then define on the fly which language to display it in, as well as
force that language rules for indexes & sorting.  I know how to set
COLLATION for the sorting / index rules but how would I force the select
results to be displayed in another language such as French or German?

Thanks in advance




Re: Internationalization

От
Ian Lawrence Barwick
Дата:
2014-03-14 6:27 GMT+09:00 CS DBA <cs_dba@consistentstate.com>:
> Hi All;
>
> we want to store data in a generic fashion (COLLATION / ENCODING?)
>
> and then define on the fly which language to display it in, as well as force
> that language rules for indexes & sorting.  I know how to set COLLATION for
> the sorting / index rules but how would I force the select results to be
> displayed in another language such as French or German?

I'm not quite sure what you want to achieve here. PostgreSQL can't possibly
know what language the data in a given column is in, so you'd need to have
some kind of identifier (e.g. separate column specifying the language).

A more concrete example of what you want to do would help.

Regards

Ian Barwick


Re: Internationalization

От
Kasia Tuszynska
Дата:
CS DBA,
If you are storing multiple languages in a Postgres database and you choose UTF-8 and "C" or "POSIX" for the collation
parameters,you will indeed be able to store any and all languages, but as Ian said Postgres does not have a switch to
tellit to sort an index in a particular language, so your index sorts will come back in ascii order.
 
If you want sorts in a specific language, you need to create a db with encoding and the two collation parameters
specificto that language like German.
 

Sincerely,
Kasia 

-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Ian Lawrence Barwick
Sent: Thursday, March 13, 2014 5:58 PM
To: CS DBA
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Internationalization

2014-03-14 6:27 GMT+09:00 CS DBA <cs_dba@consistentstate.com>:
> Hi All;
>
> we want to store data in a generic fashion (COLLATION / ENCODING?)
>
> and then define on the fly which language to display it in, as well as 
> force that language rules for indexes & sorting.  I know how to set 
> COLLATION for the sorting / index rules but how would I force the 
> select results to be displayed in another language such as French or German?

I'm not quite sure what you want to achieve here. PostgreSQL can't possibly know what language the data in a given
columnis in, so you'd need to have some kind of identifier (e.g. separate column specifying the language).
 

A more concrete example of what you want to do would help.

Regards

Ian Barwick


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