Bug #637: pltcl bug with multibyte support - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #637: pltcl bug with multibyte support
Date
Msg-id 20020420090418.4F772475912@postgresql.org
Whole thread Raw
List pgsql-bugs
Yury Don (yura@vpcit.ru) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
pltcl bug with multibyte support

Long Description
I have a database with KOI8 encoding, many tables names and fields names contain cyrillic characters.
And I have a trigger on pltcl with the following code:
CREATE or replace FUNCTION log_event() RETURNS opaque AS '
  foreach fld [array names NEW] {
    elog DEBUG "field=${fld}"
  }
return OK
}
' LANGUAGE 'pltcl';
In postgres 7.1 everything worked well, but in 7.2 I am getting an errors:
"NOTICE:  utf_to_local: could not convert UTF-8 ..." for every field whose 
name contains cyrillic characters. In postgresql.log there are string 
field=<field name> for every field whose name doesn't contain  cyrillic characters
and string field= for every field whose name contains cyrillic characters.
I removed converting utf to local code from pltcl.c (just replacing 
#if defined(UNICODE_CONVERSION) && TCL_MAJOR_VERSION == 8 \
to
#if defined(UNICODE_CONVERSION_1) && TCL_MAJOR_VERSION == 8 \)
and now everything works well as it was in postgresql 7.1
My environment:
Debian Linux, Postgresql version 7.2.1 compiled with multibyte support 
(--enable-unicode-conversion, --enable-multibyte, --enable-locale), 
tcl version 8.3


Sample Code


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch for memory leaks in index scan
Next
From: PATHHARA1@aol.com
Date:
Subject: PostgreSql Installation