Re: ORDER BY 'criteria' - Mailing list pgsql-general

From Dennis Gearon
Subject Re: ORDER BY 'criteria'
Date
Msg-id 98FDSQ0NHHBICRNGEJIBUQHCE0TS85.3e306e9b@cal-lab
Whole thread Raw
In response to Re: ORDER BY 'criteria'  (Ian Barwick <barwick@gmx.net>)
List pgsql-general
The init_db listed, does this init a particular DATABASE, or the WHOLE ENGINE to a particular
language encoding?

If it's the former that takes place, then spreading the schema out over databases would solve
the problem if the application code kept track of everything. (Pain in the butt)

>> I want to pull out groups of records by language and the country, and then
>>     SORT THE RECORDS IN THE LANGUAGE SELECTED.
>>
>> Is there any way to say which language to ORDER BY in an SQL statement? Is
>> there in the SQL standard?
>
>You mean "is there any way to determine the sort order used by
>ORDER BY", i.e. for records defined as Russian and containing Cyrillic UTF-8
>characters use Russian sorting order etc.?
>
>The short answer is "no" (I am happy to be proven wrong of course ;-).
>As far as PostgreSQL is concerned, the locale used to determine sorting
>order is predefined at initdb and can't be changed dynamically.
>I don't know what the SQL standards say about this.
>
>There is probably no practical way of doing what you are looking for,
>especially when you consider the sorting order of some languages
>cannot be algorithmically determined. Japanese for example would
>require an extra field containing a phonetic key for each record.
>For example, in the following two words the first character is the same,
>but the first word is pronounce "Kobe" and the second "Kanda":
>  神戸
>  神田
>(the first character can also be pronounced "shin" or "kami").
>
>> If not, this is a serious deficiency for global companies.




pgsql-general by date:

Previous
From: "Enrico Comini"
Date:
Subject: pg_dump automatic
Next
From: Peter Eisentraut
Date:
Subject: Re: standard schemas for addresses, others?