Search Postgresql Archives

Re: Seeking rows whit \

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 19, 2008 at 7:56 AM, Francisco Reyes <lists@xxxxxxxxxxxxxxxx> wrote:
Is there a way to search for rows with the character \?

I tried variants of like and  ~.

create table mytable (f1 text);
insert into mytable values ('Test row 1');
insert into mytable values (E'Test row 2 \\');

select * from mytable where f1 like E'%\\%'; <-- returned nothing
select * from mytable where f1 ~ '\'; <-- waiting for single quote
select * from mytable where f1 ~ E'\\'; <-- Error

And a few more variants.. with no valid reults.

Any suggestions?



It is well documented. Quoting from http://www.postgresql.org/docs/8.3/interactive/functions-matching.html#FUNCTIONS-LIKE

Thus, writing a pattern that actually matches a literal backslash means writing four backslashes in the statement.

Best regards,
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

Mail sent from my BlackLaptop device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux