Re: pg_dump error - LOCALIZATION PROBLEM

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Erol Öz <eroloz(at)esg(dot)com(dot)tr>, PostgreSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump error - LOCALIZATION PROBLEM
Date: 2001-09-16 23:18:18
Message-ID: 19277.1000682298@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

>> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message peace_flower 2001-09-17 01:19:56 MySQL development MUST immdediately cease - Due to GlobalEconomic condition..
Previous Message Peter Eisentraut 2001-09-16 23:04:18 Re: pg_dump error - LOCALIZATION PROBLEM

Browse pgsql-hackers by date

  From Date Subject
Next Message speedboy 2001-09-16 23:46:29 pg_dump and -U flag.
Previous Message Peter Eisentraut 2001-09-16 23:04:18 Re: pg_dump error - LOCALIZATION PROBLEM