Skip to content

Instantly share code, notes, and snippets.

@felixge
Last active September 13, 2019 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felixge/ee86a3269202efcc2ae870eed19eaae2 to your computer and use it in GitHub Desktop.
Save felixge/ee86a3269202efcc2ae870eed19eaae2 to your computer and use it in GitHub Desktop.
SELECT version();
version
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11.5 (Debian 11.5-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)
-- Why is this returning true?
-- I think { and [ are considered to sort equally on this machine's `en_US` collation,
-- so the result is the same as `'{' < '{a'`
SELECT '{' < '[a' COLLATE "en_US";
?column?
----------
t
(1 row)
SELECT '{' < '[a' COLLATE "C";
?column?
----------
f
(1 row)
SELECT version();
version
-------------------------------------------------------------------------------------------------------------
PostgreSQL 11.5 on x86_64-apple-darwin16.7.0, compiled by Apple LLVM version 8.1.0 (clang-802.0.42), 64-bit
(1 row)
SELECT '{' < '[a' COLLATE "en_US";
?column?
----------
f
(1 row)
SELECT '{' < '[a' COLLATE "C";
?column?
----------
f
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment