Re: BUG #1931: ILIKE and LIKE fails on Turkish locale - Mailing list pgsql-bugs

From Victor Snezhko
Subject Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Date
Msg-id upsea1x6p.fsf@indorsoft.ru
Whole thread Raw
In response to Re: BUG #1931: ILIKE and LIKE fails on Turkish locale  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
Responses Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
List pgsql-bugs
Volkan YAZICI <yazicivo@ttnet.net.tr> writes:

> On Sep 04 02:35, Tom Lane wrote:
>> "Devrim GUNDUZ" <devrim@gunduz.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.
>>=20
>> 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.=20

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 "=C8" (unicode id: 0x0445, utf-8
   representation is D1 85) with the following weird error:

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

the following query fails:

CREATE OR REPLACE FUNCTION TestFunction()
RETURNS int
AS $$
BEGIN
  SELECT =C8 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?

--=20
WBR, Victor V. Snezhko
E-mail: snezhko@indorsoft.ru

pgsql-bugs by date:

Previous
From: Volkan YAZICI
Date:
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale
Next
From: Victor Snezhko
Date:
Subject: Re: BUG #1931: ILIKE and LIKE fails on Turkish locale