[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] LIKE operator and string comparison
From:       Tom Lane <tgl () sss ! pgh ! pa ! us>
Date:       2004-09-22 23:20:48
Message-ID: 19719.1095895248 () sss ! pgh ! pa ! us
[Download RAW message or body]

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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic