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

LIKE operator and string comparison

From: Wei Weng <wweng(at)kencast(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: LIKE operator and string comparison
Date: 2004-09-22 22:54:46
Message-ID: 415202B6.7060903@kencast.com (view raw or flat)
Thread:
Lists: pgsql-sql
I used the following SQL code to match '\foo\bar'

SELECT text FROM test WHERE text LIKE '\\\\foo\\\\%'

But if I choose to use string comparison, instead of 4 escape characters, I 
only need 2.

SELECT text FROM test WHERE text = '\\foo\\bar'

Why is that?

I am using PostgreSQL 7.4, and the SQL code was entered through psql.

Thanks!

Wei

Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2004-09-22 23:09:44
Subject: Re: LIKE operator and string comparison
Previous:From: Josh BerkusDate: 2004-09-22 17:16:02
Subject: Re: Porting problem from Informix to Postgres...

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