Re: pg_dump error - LOCALIZATION PROBLEM - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dump error - LOCALIZATION PROBLEM
Date
Msg-id 19277.1000682298@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump error - LOCALIZATION PROBLEM  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
>> Hmm.  Given that we expect the lexer to have downcased any unquoted
>> words, this seems like a workable solution --- where else are we using
>> strcasecmp() unnecessarily?

Wait a minute --- I spoke too quickly.  The lexer's behavior is to
downcase unquoted identifiers in a *locale sensitive* fashion --- it
uses isupper() and tolower().  We concluded that that was correct for
identifiers according to SQL99, whereas keyword matching should not be
locale-dependent.  See the comments for ScanKeywordLookup.

> I've identified several other such places.  However, in reality we have to
> consider every single strcasecmp() call suspicious.  In many places an
> ASCII-only alternative is needed or the code needs to be rewritten.

I think our problems are worse than that: once the identifier has been
through a locale-dependent case conversion we really have a problem
matching it to an ASCII string.  The only real solution may be to
require *all* keywords to be matched in the lexer, and forbid strcmp()
matching in later phases entirely.

            regards, tom lane

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_dump error - LOCALIZATION PROBLEM
Next
From: Charles Tassell
Date:
Subject: Re: Transactions <-> Connections and Userrights