Re: ORDER BY 'criteria'

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: pgsql-general(at)postgresql(dot)org, Ian Barwick <barwick(at)gmx(dot)net>
Subject: Re: ORDER BY 'criteria'
Date: 2003-01-23 22:37:15
Message-ID: 98FDSQ0NHHBICRNGEJIBUQHCE0TS85.3e306e9b@cal-lab
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Enrico Comini 2003-01-23 22:41:05 pg_dump automatic
Previous Message Stephan Szabo 2003-01-23 21:52:49 Re: Problem with plpgsql TRIGGER