Skip site navigation (1) Skip section navigation (2)

Re: BUG #1931: ILIKE and LIKE fails on Turkish locale

From: Victor Snezhko <snezhko(at)indorsoft(dot)ru>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Date: 2006-09-05 09:26:22
Message-ID: upsea1x6p.fsf@indorsoft.ru (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-tr-genel
Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:

> On Sep 04 02:35, Tom Lane wrote:
>> "Devrim GUNDUZ" <devrim(at)gunduz(dot)org> writes:
>> > Like the bug report that was submitted a few days ago,
>> > http://archives.postgresql.org/pgsql-bugs/2005-09/msg00233.php
>> > I have the same thing for Turkish locale.
>> 
>> Would you confirm that this is fixed by my recent commit?
>
> I've made some tests. [AFAICS, below results are applicable for all
> latinN encodings.]
>
>   Cluster Locale | client_encoding | upper() | lower() | ILIKE | ~*
> -----------------+-----------------+---------+---------+-------+----
>  tr_TR.iso8859-9 |          LATIN5 |      OK |      OK |    OK |    OK
>  tr_TR.iso8859-9 |            UTF8 |      OK |      OK |    OK |    OK
>      tr_TR.UTF-8 |          LATIN5 |      OK |      OK |    OK | FAILS
>      tr_TR.UTF-8 |            UTF8 |      OK |      OK |    OK | FAILS
>
> Looks like regex code needs same modifications done to ILIKE command.

I have applied the patch for like.c: r 1.64 -> r 1.65, to my
postgresql 8.1.4 sources, and ILIKE now, obviously, works for
ru_RU.UTF-8 locale.

I still have a couple of issues, though, not sure if anyone reported
them yet. 

1) When table or column names are multibyte, they are not displayed by
   either psql or pgAdmin. What I see is empty strings instead of
   table names. It works with latin table names and with national
   table names on single-byte encodings.

2) When I try to create a stored procedure to create table (e.g., for
   creating table only if it doesn't already exist), it fails to
   compile if i use cyrillic letter "х" (unicode id: 0x0445, utf-8
   representation is D1 85) with the following weird error:

ERROR:  expected dot between identifiers: х
CONTEXT:  compile of PL/pgSQL function "createoraltertable" near line 2

the following query fails:

CREATE OR REPLACE FUNCTION TestFunction()
RETURNS int
AS $$
BEGIN
  SELECT х FROM test_table;
  RETURN 0;
END;
$$ LANGUAGE plpgsql;

(the only multibyte symbol is that 0x0445 letter, and it's between
select and from).

Simple create table and select, outside of function, works (except the
first issue).

What can I do to help to debug this?
Should I try the sources from CVS HEAD?

-- 
WBR, Victor V. Snezhko
E-mail: snezhko(at)indorsoft(dot)ru



In response to

Responses

pgsql-tr-genel by date

Next:From: Victor SnezhkoDate: 2006-09-05 10:40:25
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Previous:From: Nilgün Belma BugünerDate: 2006-09-05 08:39:01
Subject: Re: UNICODE veri tabanı

pgsql-bugs by date

Next:From: Victor SnezhkoDate: 2006-09-05 10:40:25
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Previous:From: Volkan YAZICIDate: 2006-09-05 08:19:42
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group