Re: Help please - completely baffled by quoting - Mailing list pgsql-general

From Tim Robinson
Subject Re: Help please - completely baffled by quoting
Date
Msg-id 007501c456dc$dcd7a390$0200a8c0@bart
Whole thread Raw
In response to Re: Help please - completely baffled by quoting  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general

> -----Original Message-----
> From: Peter Eisentraut [mailto:peter_e@gmx.net]
> Sent: 20 June 2004 14:07
> To: Tim Robinson; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Help please - completely baffled by quoting
>
>
> Tim Robinson wrote:
> >     select * from temp where a like 'a\\\'%'
> >
> > this should return all strings starting with a\' but it returns
> > nothing!!!
>
> \ is also the quoting character of LIKE, in addition to being
> a quoting
> character on the string literal level.  If you want all strings
> starting with a\' then use something like:
>
> a LIKE 'a\\\'%' ESCAPE '!'
>
> where '!' selects some other escape character for LIKE that
> doesn't get
> in the way.  The documentation on LIKE contains the details on this
> mechanism.
>

or..
    a LIKE 'a\\\\\'%'

thanks, I get it now :)

--- Tim


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Relocation error pg_dumpall undefined symbol get_progname
Next
From: kumar mcmillan
Date:
Subject: pivot table sql -- COUNT() not working as expected