Re: Changing DB Encodings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Naz Gassiep <naz(at)mira(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Changing DB Encodings
Date: 2007-07-07 23:50:03
Message-ID: 15092.1183852203@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Naz Gassiep <naz(at)mira(dot)net> writes:
> Tom Lane wrote:
>> No, that implies a lack of error checking.

> Surely, then, that's a bug? Shouldn't postmaster check if a DB is in an
> encoding that differs from the selected locale?

Yeah, it should. Whether it can is a different question.

Part of the problem here is the lack of a reliable way to tell
*which* encoding is implied by a locale. On some systems you
can get a poorly-standardized string name for the locale's encoding;
on others you can't get anything.

There's been some experimental code in initdb for awhile now that tries
to guess encoding from locale. I have not heard reports of it failing
lately, so maybe we could promote it into a hard error check, or at
least a backend-side warning at CREATE DATABASE time. It still won't
help on old systems without nl_langinfo(CODESET), though. (But how
many of those are left? That call is specified by the Single Unix
Spec. Anybody know if it works on Windows?)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Gould 2007-07-08 15:16:43 feature requests
Previous Message Naz Gassiep 2007-07-07 23:26:51 Re: Changing DB Encodings