Re: BUG #16789: Wrong order by output - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16789: Wrong order by output
Date
Msg-id 662062.1608673851@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16789: Wrong order by output  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> I don't know if there is anything specific to do for having a proper ordered
> output, but the result seems wrong to me.

You need to use a locale (collation) that matches your expectations.

FWIW, I get the same ordering you show with COLLATE "en_US" on a
Linux box, and it's likely that glibc would use similar ordering
rules for some other languages.  The behavior you say you want
looks like it'd match COLLATE "C", though that might act a little
funny with non-ASCII characters.

(I'm not here to defend glibc's sorting rules, but I think what
they're doing in this example is ignoring spaces in the first pass.)

You can find more about this topic in

https://www.postgresql.org/docs/current/charset.html

            regards, tom lane



pgsql-bugs by date:

Previous
From: Першин Юрий Петрович
Date:
Subject: RE: BUG #16787: ODBC driver (libpq.dll, psqlodbc30a.dll, psqlodbc30w.dll) issues
Next
From: Michael Paquier
Date:
Subject: Re: BUG #16780: Inconsistent recovery_target_xid handling across platforms