Problem with Turkish localization

From: Sezai Yilmaz <sezaiy(at)ata(dot)cs(dot)hun(dot)edu(dot)tr>
To: PGSQL-BUGS <pgsql-bugs(at)postgresql(dot)org>
Subject: Problem with Turkish localization
Date: 2000-07-21 10:35:53
Message-ID: Pine.LNX.4.10.10007211331580.1451-100000@ata.cs.hun.edu.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-bugs by date

  From Date Subject
Next Message jfaith 2000-07-21 10:54:27 postgres bug report
Previous Message Volker Paul 2000-07-21 09:10:50 Re: problem with view and case - please help