pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow strings are sorted by LC_COLLATE specifically?
3+ messages / 2 participants
[nested] [flat]
* How strings are sorted by LC_COLLATE specifically?
@ 2010-11-25 05:42 Chang Chao <charleschung.cn@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Chang Chao @ 2010-11-25 05:42 UTC (permalink / raw)
To: pgsql-sql
Hello Dear All.
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.
Any clue will be greatly appreciated.
Charles
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How strings are sorted by LC_COLLATE specifically?
@ 2010-11-30 19:31 Peter Eisentraut <peter_e@gmx.net>
parent: Chang Chao <charleschung.cn@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Peter Eisentraut @ 2010-11-30 19:31 UTC (permalink / raw)
To: Chang Chao <charleschung.cn@gmail.com>; +Cc: pgsql-sql
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How strings are sorted by LC_COLLATE specifically?
@ 2010-12-01 14:31 Chang Chao <charleschung.cn@gmail.com>
parent: Peter Eisentraut <peter_e@gmx.net>
0 siblings, 0 replies; 3+ messages in thread
From: Chang Chao @ 2010-12-01 14:31 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: 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@gmx.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.
>
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2010-12-01 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-25 05:42 How strings are sorted by LC_COLLATE specifically? Chang Chao <charleschung.cn@gmail.com>
2010-11-30 19:31 ` Peter Eisentraut <peter_e@gmx.net>
2010-12-01 14:31 ` Chang Chao <charleschung.cn@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox