Re: postgres & server encodings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Salem Berhanu <salemb4(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: postgres & server encodings
Date: 2005-08-09 16:48:09
Message-ID: 17067.1123606089@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Lincoln Yeoh 2005-08-09 16:52:00 Re: postgres & server encodings
Previous Message Martijn van Oosterhout 2005-08-09 15:59:46 Re: postgres & server encodings

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2005-08-09 16:52:00 Re: postgres & server encodings
Previous Message Jan Wieck 2005-08-09 16:37:49 Re: Query stucked in pg_stat_activity