Re: BUG #16077: Sorting of table list depends on platform

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: thomas(dot)bessou(at)stockly(dot)ai
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16077: Sorting of table list depends on platform
Date: 2019-10-24 17:01:36
Message-ID: 11505.1571936496@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-10-24 18:19:29 Re: BUG #16035: STATEMENT_TIMEOUT not working when we have single quote usage inside CTE which is used in inner sql
Previous Message PG Bug reporting form 2019-10-24 16:09:58 BUG #16077: Sorting of table list depends on platform