Forum: Ruby on Rails Re: Collation order in Rails with Postgresql

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C1811befea42aaf1fa45d7136c50564d?d=identicon&s=25 nanaya (Guest)
on 2016-03-12 09:56
(Received via mailing list)
Hi,

On Sat, Mar 12, 2016, at 09:49, Donald Ziesig wrote:
>
> <none>
>
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] http://www.postgresql.org/docs/current/static/collation.html

[2]
http://www.postgresql.org/docs/current/static/sql-...

[3] http://www.postgresql.org/docs/current/static/app-...
This topic is locked and can not be replied to.