LIKE operator and string comparison - Mailing list pgsql-sql

From Wei Weng
Subject LIKE operator and string comparison
Date
Msg-id 415202B6.7060903@kencast.com
Whole thread Raw
Responses Re: LIKE operator and string comparison  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Porting problem from Informix to Postgres...
Next
From: Tom Lane
Date:
Subject: Re: LIKE operator and string comparison