Re: Cannot create UTF-8 database - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Cannot create UTF-8 database
Date
Msg-id 28972.1268411196@sss.pgh.pa.us
Whole thread Raw
In response to Cannot create UTF-8 database  ("Carlson, Jacob" <jacob.carlson@navteq.com>)
List pgsql-bugs
"Carlson, Jacob" <jacob.carlson@navteq.com> writes:
> I am trying to create a UNICODE schema and am getting an error.  Is there a configuration file I need to update to
exceptUnicode schemas?  I am using this version of software - postgresql-8.3.8-S10.i386-64.tar. 
> To note, I am able to create an ASCII encoded schema with no problem.

Postgres tries to prevent you from selecting an incompatible combination
of locale and encoding.  In general, the locale support presumes a
specific character encoding for any given locale setting, so if you were
to set a database encoding different from that, you would get strange
misbehaviors in areas like text sorting, upper/lowercasing, etc.

> Unicode Error:

> postgres=# create database "apt_utf8" with encoding = 'UNICODE';
> ERROR:  encoding UTF8 does not match server's locale C
> DETAIL:  The server's LC_CTYPE setting requires encoding LATIN1.

Hm, that is odd.  C locale is normally considered encoding-agnostic
(because it doesn't do anything with characters outside the ASCII
range).  What platform is this on?

The short answer to your question is that you're going to need to
re-initdb with a utf8-compatible locale setting, but I'm just wondering
why it wouldn't let you do it in C locale ...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: BUG #5364: citext behavior when type not in public schema
Next
From: Tom Lane
Date:
Subject: Re: BUG #5372: insert into fails with integer expression type char error