BUG #2125: SELECT problem with strings containing \ - Mailing list pgsql-bugs

From Tony
Subject BUG #2125: SELECT problem with strings containing \
Date
Msg-id 20051224194345.4F2E3F0AC8@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #2125: SELECT problem with strings containing \
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2125
Logged by:          Tony
Email address:      tonya@ananzi.co.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');

pgsql-bugs by date:

Previous
From: ""
Date:
Subject: BUG #2124: Error "relation with OID ... does not exist" when using temporary table in function.
Next
From: "David Wheeler"
Date:
Subject: BUG #2122: Inconsistent FK Error Messages