Problem with Turkish localization - Mailing list pgsql-bugs

From Sezai Yilmaz
Subject Problem with Turkish localization
Date
Msg-id Pine.LNX.4.10.10007211331580.1451-100000@ata.cs.hun.edu.tr
Whole thread Raw
List pgsql-bugs
PostgreSQL 7.x - Problem with Turkish localization

Hi.

I had a problem with Turkish localization of PostgreSQL 7.x. But I solved
it by myself.

Description:

I configure and compile PostgreSQL 7.x source
with "--enable-locale" parameter. Before running
postmaster I set environment variables related with
locale support of my Linux box.


------------------------------------------
LC_CTYPE=tr_TR
LC_COLLATE=tr_TR
LC_ALL=tr_TR
LANG=tr

export LC_CTYPE LC_COLLATE LC_ALL

postmaster .... (and necessary paramters)
------------------------------------------


So far everything is ok. I run these commands:


------------------------------------------
template1=# create database dummy;
CREATE DATABASE
template1=# \c dummy
You are now connected to database dummy.
dummy=# create table atable (x char(12));
CREATE
dummy=# \d
ERROR:  parser: parse error at or near "unýon"
ERROR:  parser: parse error at or near "unýon"
------------------------------------------

Localization support of PostgreSQL is achieved
by the help of UNIX locale support defined in
standart C libraries (PostgreSQL uses tolower
function). SQL commands are written with
capital letters in file
postgresql-7.x/src/backend/parser/gram.c.
Before executing SQL commands, they are translated
into lowercase letters with tolower() function.
As seen above "UNION" is translated into "unýon"
instead of "union" and then is executed. In Turkish
alphabet lowercase of "I" is "ý" (y acute, not "i") and
uppercase of "i" is "I" (Y acute, not "I").




Solution:


To solve this problem I convert all SQL commands
written statically in yytname character array into
lowercase commands (in file
postgresql-7.x/src/backend/parser/gram.c). Now I
am happy with my PostgreSQL and its Turkish
language support. It also has some problems
(I can not write queries in capital letters,
because of the same behaviour descibed above) but
it is not a matter.



Sezai

pgsql-bugs by date:

Previous
From: Ange Michel POZZO
Date:
Subject: problem with view and case - please help
Next
From: jfaith
Date:
Subject: postgres bug report