emanuel.calvo@2ndquadrant.com writes:
> When trying to create COLLATIONS, I'm facing some issues:
I see no bugs here, just misunderstanding of the commands.
> postgres=# CREATE COLLATION le_english (LOCALE = "en_US.utf8");
> ERROR: encoding "LATIN1" does not match locale "en_US.utf8"
> DETAIL: The chosen LC_CTYPE setting requires encoding "UTF8".
Your current database is using encoding LATIN1, so you need to reference
a locale that matches that, perhaps "en_US.iso88591". (Hard to be sure
about the exact spelling, since you didn't provide your platform.)
> postgres=# CREATE COLLATION le_english (LOCALE = "en_US.utf8", LC_CTYPE =
> "UTF8");
> ERROR: conflicting or redundant options
You specify either locale or lc_ctype+lc_collate, not both.
> postgres=# CREATE COLLATION le_english (LC_COLLATE = "UTF8", LC_CTYPE =
> "UTF8");
> ERROR: could not create locale "UTF8": Success
I get this (on RHEL6):
l1=# CREATE COLLATION le_english (LC_COLLATE = "UTF8", LC_CTYPE = "UTF8");
ERROR: could not create locale "UTF8": No such file or directory
DETAIL: The operating system could not find any locale data for the locale name "UTF8".
which is what I'd expect, since it seems unlikely that any platform
would name a locale setting just "UTF8".
What seems likely is that there's something bogus about the locale data on
your machine. Or maybe there's a platform-specific issue in how PG is
interrogating that data ... but since you did not provide your platform
information, we have no way to investigate that.
regards, tom lane