views:

292

answers:

1

I am changing from MySQL to PostgreSQL but can't find equivalent to MySQL's collation utf8_general_ci. What I'm trying to achieve here is to be able to compare strings using general language rules rather then binary comparison, i.e. í = i, š = s, ḩ = h, etc...

Is there a way how to make PostgreSQL search for strings using general language rules?

Many thanks!

+1  A: 

This is, basically, what most modern postgresql installations will do for you by default. But you may also be interested in initdb options --locale, --lc-collate, etc. (most of those, if not all can also be changed after the database is initialized using .conf file).

You can also specify encoding and IIRC LC_COLLATE and friends when creating database.

Michael Krelin - hacker
Thanks. Could you also advice me on what locale can be used as a general one?
David
Whichever. I'm using `en_US.utf8`. I take it unicode collation doesn't depend on locale.
Michael Krelin - hacker