Re: BUG #10255: CREATE COLLATION bug on 9.4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: emanuel(dot)calvo(at)2ndquadrant(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #10255: CREATE COLLATION bug on 9.4
Date: 2014-05-07 16:43:46
Message-ID: 30276.1399481026@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

emanuel(dot)calvo(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2014-05-07 16:52:10 Re: BUG #10255: CREATE COLLATION bug on 9.4
Previous Message Tom Lane 2014-05-07 16:11:41 Re: Server process crash - Segmentation fault