Turkish downcasting in PL/pgSQL - Mailing list pgsql-bugs

From ntufar
Subject Turkish downcasting in PL/pgSQL
Date
Msg-id 1092313616.2843.42.camel@localhost
Whole thread Raw
Responses Re: Turkish downcasting in PL/pgSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Turkish downcasting in PL/pgSQL  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
Your name               :
Your email address      :


System Configuration
---------------------
  Architecture (example: Intel Pentium)         : Intel Pentium

  Operating System (example: Linux 2.4.18)      : Debian unstable
                          Linux 2.6.6-1-k7

  PostgreSQL version (example: PostgreSQL-8.0):  PostgreSQL-8.0 CVS HEAD

  Compiler used (example:  gcc 2.95.2)          : gcc 3.3.4


Please enter a FULL description of your problem:
------------------------------------------------

Problems with Turkish locale are widely known to developers.
Another one, now in PL/pgSQL have reared it's ugly head.
Regression tests are failing at triggers, plpgsql, copy2
and rangefuncs. Examienation of regression.diff showed that
the failures were due to unrecognised statements like
BEGIN, RAISE and IF in PL/pgSQL functions. Replacing
capital "I" with lower-case "i" (BEGiN, RAiSE, iF) completely
sloves the problem.


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Apparently problem is caused by the following directive:

     %option case-insensitive

on line 76 in file src/pl/plpgsql/src/scan.l

flex (flex version 2.5.4) incorporates case-insensitivity in it's
state tables because if I run flex stage with LANG=C everything
works fine. A quick and dirty fix could be implemented by placing

     LANG=C
     export LANG

in file src/pl/plpgsql/src/Makefile before calling flex.

A long term fix can be done by implementing a function
for keyword lookup like ScanKeywordLookup() in
src/backend/parser/keywords.c.

I would gladly prepare a patch and send it for your consideration
tomorrow morning.

Best regards,
Nicolai Tufar

pgsql-bugs by date:

Previous
From: David Fetter
Date:
Subject: Re: postgres 7.1.3 wth perl 5.8.0
Next
From: Kris Jurka
Date:
Subject: Re: BUG #1211: JDBC connection