On 2019-12-16 01:26, Thomas Munro wrote:
While wondering about that, I noticed the "C.UTF-8" encoding (here on
a glibc system):

postgres=# \pset null <NULL>
Null display is "<NULL>".
postgres=# select collname, collprovider, collencoding, collcollate,
collctype, collversion from pg_collation ;
   collname  | collprovider | collencoding | collcollate | collctype  |
collversion
------------+--------------+--------------+-------------+------------+-------------
  default    | d            |           -1 |             |            | <NULL>
  C          | c            |           -1 | C           | C          | <NULL>
  POSIX      | c            |           -1 | POSIX       | POSIX      | <NULL>
  ucs_basic  | c            |            6 | C           | C          | <NULL>
  C.UTF-8    | c            |            6 | C.UTF-8     | C.UTF-8    | 2.28
  en_NZ.utf8 | c            |            6 | en_NZ.utf8  | en_NZ.utf8 | 2.28
  en_NZ      | c            |            6 | en_NZ.utf8  | en_NZ.utf8 | 2.28
(7 rows)

I wonder if we should do something to give that no collversion, since
we know that it's really just another way of spelling "binary sort
please", or if we'd be better off not trying to interpret the names
locale -a spits out.

I think it's worth handling that separately. If we want to give it an air of generality and not just hard-code that one locale name, we could strip off the encoding and compare the rest with the well-known encoding names.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Reply via email to