Different behaviour in “order by” clause: Oracle vs. PostgreSQL

穿精又带淫゛_ 提交于 2019-11-29 15:23:30
klin

Postgres has only two built-in collations: C and POSIX. Any other collations are provided by operating system. On many linux systems in UTF locales all non alphanumeric characters are ignored during sorting.

You can obtain expected result using collate C:

select a, length(a) from foo order by a collate "C";

You can find more detailed explanation in this answer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!