From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martijn van Oosterhout <kleptog@svana.org>
Cc: Salem Berhanu <salemb4@hotmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: postgres & server encodings
Date: Tue, 09 Aug 2005 12:48:09 -0400
Message-ID: <17067.1123606089@sss.pgh.pa.us> (raw)
In-Reply-To: <20050809155946.GF8244@svana.org>
References: <BAY9-F39yzvZlhK3CHl0007db08@hotmail.com>
<BAY103-F36DC25F51006C5179B29E0EFB80@phx.gbl>
<20050809155946.GF8244@svana.org>
Martijn van Oosterhout <kleptog@svana.org> writes:
> SQL_ASCII means that the database does no locale specific or language
> specific encoding ever. It won't check what you send it either. If
> you're content to let clients deal with any encoding issues, this may
> be what you want.
> But anything to do with lower(), upper(), case-insenstive in the
> database itself will be totally stupid since it's assuming ASCII.
Actually it's worse than that: case conversion and comparisons inside
the database will still be done using whatever locale setting the
database was initdb'd with. If that locale is C, then you have just
ASCII-aware case conversions and memcmp-like sorting, but everything
will behave reasonably sanely within those limitations. If the locale
is not C then it is assuming some specific encoding that *the database
is not enforcing*. This is bad news and can result in all sorts of
inconsistent behavior.
We really need to figure out some way of enforcing that the database
encoding is OK to use with the locale setting. Peter put some trial
code for this into initdb in 8.0, but it's only issuing a warning rather
than enforcing the restriction, so I don't have a lot of confidence
that it is right. (How many people even noticed the warning message?)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, kleptog@svana.org, salemb4@hotmail.com, pgsql-general@postgresql.org
Subject: Re: postgres & server encodings
In-Reply-To: <17067.1123606089@sss.pgh.pa.us>
References: <BAY9-F39yzvZlhK3CHl0007db08@hotmail.com> <BAY103-F36DC25F51006C5179B29E0EFB80@phx.gbl> <20050809155946.GF8244@svana.org> <17067.1123606089@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox