Re: [GENERAL] pg_dump error - LOCALIZATION PROBLEM - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] pg_dump error - LOCALIZATION PROBLEM
Date
Msg-id 5685.1000755583@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] pg_dump error - LOCALIZATION PROBLEM  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> 2. Using strcasecmp() on strings that were parsed as keywords.  See CREATE
> OPERATOR, CREATE AGGREGATE, CREATE TYPE, commands/define.c.

But the real point is that they were parsed as identifiers, *not*
keywords, and therefore have already been through a locale-dependent
case conversion.  (Look at what happens in scan.l after
ScanKeywordLookup fails.)  Unless we can undo or short-circuit that,
it won't help to apply a correct ASCII-only comparison.

Possibly we should change the parser's Ident node type to carry both the
raw string and the downcased-as-identifier string.  The latter would
serve the existing needs, the former could be used for keyword matching.

> For #2, we should export parts of ScanKeywordLookup as a generic function,
> perhaps "normalize_identifier", ...
> For #4, we need some ASCII-only strcasecmp version.

I think these are the same thing.
        regards, tom lane


pgsql-hackers by date:

Previous
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: 7.2 RPMs
Next
From: Thomas Lockhart
Date:
Subject: Re: Beta time