Re: How strings are sorted by LC_COLLATE specifically?

From: Chang Chao <charleschung(dot)cn(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How strings are sorted by LC_COLLATE specifically?
Date: 2010-12-01 14:31:33
Message-ID: AANLkTinYeN1FdhtYqOBr34MxpDYz4qceHXK58Sc0Y1eC@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Peter.

When I looked into the source(),came to know that strings are sorted like this.

int result = strcoll(a, b);
if (result == 0) {
result = strcmp(a,b);
}
return result;

On Wed, Dec 1, 2010 at 4:31 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On tor, 2010-11-25 at 14:42 +0900, Chang Chao wrote:
>> How strings are sorted when LC_COLLATE = ja_JP.UTF-8.
>> I tried to read the documention on that,but there are just a few
>> words,
>> like LC_COLLATE determines string sort order,
>> Is there a specific reference about this?
>> So I can implement an equivalent string sort function in JAVA.
>> because some of the sort logic is here.
>
> The actual string comparison is done by the strcoll() function in the
> operating system's C library.
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Bland 2010-12-01 15:07:16 Re: DELETE WHERE EXISTS unexpected results
Previous Message John Fabiani 2010-12-01 14:29:10 Re: OT - load a shp file