Skip to content

Instantly share code, notes, and snippets.

@puffy
Created February 11, 2012 16:38
Show Gist options
  • Save puffy/1801949 to your computer and use it in GitHub Desktop.
Save puffy/1801949 to your computer and use it in GitHub Desktop.
Существует проблема сортировки текстовых полей postgresql на Mac OS X (возможно и FreeBSD, не знаю как сейчас) при использовании мультибайтовой кодировки UTF-8. Здесь приведен один из вариантов решения данной проблемы.
# psql -h localhost postgres
postgres=# create database mydb_test with lc_collate='C';
ERROR: new collation (C) is incompatible with the collation of the template database (ru_RU.UTF-8)
HINT: Use the same collation as in the template database, or use template0 as template.
postgres=# UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
postgres=# create database mydb_test with lc_collate = 'C' template = template0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment