From: Tom Lane <tgl@sss.pgh.pa.us>
To: thomas.bessou@stockly.ai
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16077: Sorting of table list depends on platform
Date: Thu, 24 Oct 2019 13:01:36 -0400
Message-ID: <11505.1571936496@sss.pgh.pa.us> (raw)
In-Reply-To: <16077-6f297cabd744c86c@postgresql.org>
References: <16077-6f297cabd744c86c@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> Running the following query:
> ```
> SELECT table_name, table_schema from information_schema.tables
> WHERE table_schema = 'your schema' AND table_type LIKE 'BASE TABLE' ORDER BY
> table_name;
> ```
> The output differs on Linux and Mac versions, though the tables are the same
> (setup by the same script from an empty database).
> We would assume ORDER BY has the same behaviour on all platforms.
Unfortunately, that assumption is wrong.
As it happens, this particular query will sort consistently beginning
in v12, because the information_schema object name columns will now
use C collation by default; before that they used the database's default
collation. But *all* non-C collations are potentially platform-dependent,
because there's not a lot of agreement between different libc vendors
as to what the sort order is, even for the "same" locale name. Postgres
is not in a position to impose some kind of standard there.
We have some documentation about this:
https://www.postgresql.org/docs/current/locale.html
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, thomas.bessou@stockly.ai
Subject: Re: BUG #16077: Sorting of table list depends on platform
In-Reply-To: <11505.1571936496@sss.pgh.pa.us>
References: <16077-6f297cabd744c86c@postgresql.org> <11505.1571936496@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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