BUG #2125: SELECT problem with strings containing \

From: "Tony" <tonya(at)ananzi(dot)co(dot)za>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2125: SELECT problem with strings containing \
Date: 2005-12-24 19:43:45
Message-ID: 20051224194345.4F2E3F0AC8@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2125
Logged by: Tony
Email address: tonya(at)ananzi(dot)co(dot)za
PostgreSQL version: 80100
Operating system: XP SP2
Description: SELECT problem with strings containing \
Details:

Hi,

Please refer to the DDL and data below:

When running a query such as:

select folder from public.folders
where lower(folder) like '%c:\\1%'

no rows are returned

However,

select folder from public.folders
where lower(folder) like '%c:%'

does work OK.

When the query string contains a \\ (escaped \) no results are returned.
Other combinations not containing this character work OK. I've tried without
the % wildcard without success so this does not appear to be the problem.
I've also tried it without the lower function either, still no luck. Using
the \\ to insert records works fine (as shown below).

Table DDL:
----------
create table public.folders(
folder varchar(255) ,
lastfolder varchar(255) ) with oids

Here are some INSERTS to populate data:
---------------------------------------
insert into public.folders values ('C:\\1\\', '1');
insert into public.folders values ('C:\\111\\', '111');
insert into public.folders values ('C:\\115x\\', '115x');
insert into public.folders values ('C:\\11tx\\', '11tx');
insert into public.folders values ('C:\\2005\\', '2005');
insert into public.folders values ('C:\\2005\\(12)December\\',
'(12)December');
insert into public.folders values ('C:\\2005\\(12)December\\051209\\',
'051209');
insert into public.folders values ('C:\\2005\\12 December\\', '12
December');
insert into public.folders values ('C:\\2005\\12 December\\12\\', '12');
insert into public.folders values ('C:\\776\\', '776');

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sagi Bashari 2005-12-25 09:34:42 Re: [BUGS] BUG #2120: Crash when doing UTF8<->ISO_8859_8
Previous Message Tatsuo Ishii 2005-12-24 00:27:23 Re: [BUGS] BUG #2120: Crash when doing UTF8<->ISO_8859_8