dbTalk Databases Forums  

[BUGS] BUG #1454: error in "select * from table where a1 like '%\%%' " ???

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1454: error in "select * from table where a1 like '%\%%' " ??? in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ricky
 
Posts: n/a

Default [BUGS] BUG #1454: error in "select * from table where a1 like '%\%%' " ??? - 02-02-2005 , 11:25 PM







The following bug has been logged online:

Bug reference: 1454
Logged by: Ricky
Email address: ricky (AT) ez2 (DOT) us
PostgreSQL version: 8.0
Operating system: Mandrake Linux 10.1
Description: error in "select * from table where a1 like '%\%%' " ???
Details:

I perform a query to get data,which contains '%'.
so I do this query.
select * from table where a1 like '%\%%';
but it returns all rows.
then I do another query.
select * from table where a1 like '\%';
but it still return all rows.
like "select * from table"

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] BUG #1454: error in "select * from table where a1 like '%\%%' " ??? - 02-03-2005 , 12:58 AM






Ricky wrote:
Quote:
I perform a query to get data,which contains '%'.
so I do this query.
select * from table where a1 like '%\%%';
but it returns all rows.
select * from table where a1 like '%\\%%';

The first \ escapes the second \ for the string parser, the second \ is
the escape character for the LIKE pattern.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.