Last active
September 13, 2019 11:41
-
-
Save felixge/ee86a3269202efcc2ae870eed19eaae2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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