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

Re: BUG #2125: SELECT problem with strings containing \

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tony" <tonya(at)ananzi(dot)co(dot)za>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2125: SELECT problem with strings containing \
Date: 2005-12-27 15:29:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"Tony" <tonya(at)ananzi(dot)co(dot)za> writes:
> When running a query such as:
> select folder from public.folders
> where lower(folder) like '%c:\\1%'
> no rows are returned

This is not a bug --- you've forgotten that backslash is an escape
character in LIKE patterns.  You can either double it again:

	like '%c:\\\\1%'

or select a different escape character, or maybe better not have any
escape character at all:

	like '%c:\\1%' escape ''


			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2005-12-27 15:48:54
Subject: Re: BUG #2124: Error "relation with OID ... does not exist" when
Previous:From: Tom LaneDate: 2005-12-27 15:24:12
Subject: Re: BUG #2126: Index usage for function value

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