Re: locale-specific sort algorithms undocumented? - Mailing list pgsql-general

From Tom Lane
Subject Re: locale-specific sort algorithms undocumented?
Date
Msg-id 17152.1090801655@sss.pgh.pa.us
Whole thread Raw
In response to locale-specific sort algorithms undocumented?  (John Gunther <mail@bucksvsbytes.com>)
Responses Re: locale-specific sort algorithms undocumented?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
John Gunther <mail@bucksvsbytes.com> writes:
> In the course of creating a new PG 7.4.3 server, I chose UTF-8 as my
> locale.

UTF-8 is a character set encoding, not a locale.  I suspect you may
have chosen en_US or something like that as your locale.

> I now find that sorting is very different with that setting: It
> appears, through trial and error, that all non-alphanumeric characters
> are completely ignored by ORDER BY.

I doubt they are ignored completely, but they probably are ignored in
the first-order comparison.  However, this is not PostgreSQL's
bailiwick; we just use whatever strcoll() behavior the C library
provides.  The correct place to be looking for this documentation
is in the libc or glibc docs.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: locale-specific sort algorithms undocumented?
Next
From: Bill Moran
Date:
Subject: Re: Sql injection attacks