Re: LIKE operator and string comparison - Mailing list pgsql-sql

From Tom Lane
Subject Re: LIKE operator and string comparison
Date
Msg-id 19719.1095895248@sss.pgh.pa.us
Whole thread Raw
In response to Re: LIKE operator and string comparison  (Wei Weng <wweng@kencast.com>)
List pgsql-sql
Wei Weng <wweng@kencast.com> writes:
> What about in regular strings? I do need to use backslash to escape the 
> other backslash in order to get the '\'. Why isn't that the case in LIKE 
> operation?

It is.  You write four backslashes in order to describe a string
constant value containing two backslashes.  When the LIKE code sees
that, it interprets it as one quoted backslash.

See LIKE ... ESCAPE if you'd like to use a different escape character
in the LIKE pattern.
        regards, tom lane


pgsql-sql by date:

Previous
From: Wei Weng
Date:
Subject: Re: LIKE operator and string comparison
Next
From: Kemin Zhou
Date:
Subject: plpgsql syntax