pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #16077: Sorting of table list depends on platform
2+ messages / 2 participants
[nested] [flat]
* BUG #16077: Sorting of table list depends on platform
@ 2019-10-24 16:09 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2019-10-24 16:09 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: thomas.bessou@stockly.ai
The following bug has been logged on the website:
Bug reference: 16077
Logged by: Ten Ten
Email address: thomas.bessou@stockly.ai
PostgreSQL version: 10.9
Operating system: Mac OS/Linux
Description:
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.
We have the same output for this query on Linux Postgres 10.6 and Linux
Postgres 11.5.
On Mac with Postgres 10.6 and on Mac with Postgres 10.9, we also have the
same output, but it is different from the Linux one.
This causes issues such as this one:
https://github.com/diesel-rs/diesel/issues/2202#issuecomment-544148551
Specifically, it seems the Linux version ignores underscores ('_') while
sorting this query, while the Mac version doesn't.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #16077: Sorting of table list depends on platform
@ 2019-10-24 17:01 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2019-10-24 17:01 UTC (permalink / raw)
To: thomas.bessou@stockly.ai; +Cc: pgsql-bugs@lists.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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-10-24 17:01 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 16:09 BUG #16077: Sorting of table list depends on platform PG Bug reporting form <noreply@postgresql.org>
2019-10-24 17:01 ` Tom Lane <tgl@sss.pgh.pa.us>
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