d.rericha@healthcareoss.com writes:
> Simply set a varchar field in your db to the following string:
> !"#$%'()*+,-/:;=?@[\]^_`{|}~0000&<>
> I know, I know, who would do this, right? Well, its for a certification.
> The like command works fine up with escapes up to:
> !"#$%''()*+,-/:;=?@[%
Doesn't match for me, rather unsurprisingly since this string contains
two occurrences of "'" not one.
> Notice, I added the % to the end. However, if you go any further - no
> matches:
> !"#$%''()*+,-/:;=?@[\\%
> Strangely, this works and shouldn't:
> !"#$%''()*+,-/:;=?@[\%
It's hard to tell for sure, since you've presented a garbled
interpretation of what you did rather than showing us exactly what you
did, but I'm suspecting the problem boils down to forgetting that
backslash is an escape character in Postgres string literals, and
also for LIKE itself. You should reread the manual's discussion of
LIKE:
http://www.postgresql.org/docs/8.4/static/functions-matching.html
regards, tom lane