0

I needed to add new locales to our postgresql server (PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit ). As the locales were not yet installed on Ubuntu, I added them with

sudo locale-gen fr_FR.UTF-8

the locales do show now with

locale -a

I restarted the postgresql server, but the locales aren't visible in postgresql. I cant find themp in select * from pg_collation;

When I try to create the collation manually with create collation fr_FR (LOCALE=‘fr_FR.utf8’), I get this error

ERROR: could not create locale "‘tr_tr.utf8’": Success

Am I missing a step ?

3

It looks like a syntax problem. This statement:

create collation fr_FR (LOCALE=‘fr_FR.utf8’)

has Unicode non-ASCII quotes LEFT SINGLE QUOTATION MARK and RIGHT SINGLE QUOTATION MARK instead of the normal ASCII double-quote. These fancy quotes are not delimiters for the SQL syntax, so they get interpreted as being part of the locale's name.

Try with:

create collation fr_FR (LOCALE="fr_FR.utf8");
  • Thanks. I'm always confused by quotes and double quotes in Postgres. – jlfenaux Mar 9 '16 at 3:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.