Alphanumeric case in-sensitive sorting in postgres

前端 未结 6 1158
青春惊慌失措
青春惊慌失措 2020-12-17 09:33

I am new to postrges and want to sort varchar type columns. want to explain the problem with with below example:

table name: testsorting

   order             


        
6条回答
  •  死守一世寂寞
    2020-12-17 10:36

    PostgreSQL uses the C library locale facilities for sorting strings. C library is provided by the host operating system. On Mac OS X or a BSD-family operating system,the UTF-8 locale definitions are broken and hence the results are as per collation "C".

    image attached for collation results with ubuntu 15.04 as host OS

    Check FAQ's on postgres wiki for more details : https://wiki.postgresql.org/wiki/FAQ

提交回复
热议问题