Re: postgres & server encodings - Mailing list pgsql-general

From Tom Lane
Subject Re: postgres & server encodings
Date
Msg-id 17067.1123606089@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgres & server encodings  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Query stucked in pg_stat_activity
Next
From: Tom Lane
Date:
Subject: Re: Query stucked in pg_stat_activity