Re: Database object names and libpq in UTF-8 locale on Windows

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Sebastien FLAESCH <sf(at)4js(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Database object names and libpq in UTF-8 locale on Windows
Date: 2012-10-22 17:37:08
Message-ID: 50858444.7050500@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 10/22/2012 12:53 PM, Sebastien FLAESCH wrote:

[Issues with unquoted utf8 identifiers in Windows 1252 locale]

>> I suspect this has something to do with the fact that non-quoted
>> identifiers
>> are converted to lowercase, and because my LC_CTYPE is English_United
>> States.1252,
>> the conversion to lowercase fails...

Quite possibly. The code comment says this:

/*
* SQL99 specifies Unicode-aware case normalization, which we
don't yet
* have the infrastructure for. Instead we use tolower() to
provide a
* locale-aware translation. However, there are some locales
where this
* is not right either (eg, Turkish may do strange things with
'i' and
* 'I'). Our current compromise is to use tolower() for
characters with
* the high bit set, and use an ASCII-only downcasing for 7-bit
* characters.
*/

For now your best bet is probably not to use UTF8 non-ascii chars or to
quote the identifiers.

Given we're calling to_lower() on a single byte in the code referred to,
should we even be doing that when we have a multi-byte encoding and the
high bit is set?

Aside: I'd love to fix up our treatment of identifiers, but there is
probably a LOT of very tedious work involved.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-10-22 17:38:47 Re: ToDo: KNN Search should to support DISTINCT clasuse?
Previous Message Stephen Frost 2012-10-22 17:25:47 Re: Successor of MD5 authentication, let's use SCRAM