Re: Collation order in Rails with Postgresql


On Sat, Mar 12, 2016, at 09:49, Donald Z. wrote:

What you want is the C collation[1]. You can either:

  • have it during query (MyModel.order('name COLLATE "C"')),

  • create the column with C collation (t.string :my_column, :collation => "C" iirc),

  • or set default database collation (check either CREATE DATABASE
    documentation[2] or initdb[3]).

[1] PostgreSQL: Documentation: 15: 24.2. Collation Support


[3] PostgreSQL: Documentation: 15: initdb