Skip to content

Define ordering #157

@szarnyasg

Description

@szarnyasg

In Postgres, the sort changes depending on the locale, e.g. C (byte-wise comparison) or en_US, hu_HU, etc.

postgres=# select firstname from (values ('bernard'), ('bérénice'), ('béatrice'), ('boris'), ('Astor'), ('Ástor'))
 AS l(firstname)
order by firstname collate "C";
 firstname
-----------
 Astor
 bernard
 boris
 béatrice
 bérénice
 Ástor
(6 rows)
postgres=# select firstname from (values ('bernard'), ('bérénice'), ('béatrice'), ('boris'), ('Astor'), ('Ástor'))
 AS l(firstname)
order by firstname collate "en_US";
 firstname
-----------
 Astor
 Ástor
 béatrice
 bérénice
 bernard
 boris
(6 rows)

Our other reference implementation, Neo4j, uses Java's string ordering (which is collate "C" in Postgres).

This affects both branches and also needs to be discussed in the specification.

See also: https://dba.stackexchange.com/questions/94887/what-is-the-impact-of-lc-ctype-on-a-postgresql-database

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions