Re: Cannot create UTF-8 database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Carlson, Jacob" <jacob(dot)carlson(at)navteq(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Cannot create UTF-8 database
Date: 2010-03-12 16:26:36
Message-ID: 28972.1268411196@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Carlson, Jacob" <jacob(dot)carlson(at)navteq(dot)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 except Unicode 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-03-12 17:07:29 Re: BUG #5372: insert into fails with integer expression type char error
Previous Message Robert Haas 2010-03-12 16:21:43 Re: BUG #5364: citext behavior when type not in public schema