LIKE pattern matching - Mailing list pgsql-hackers

From Thomas Lockhart
Subject LIKE pattern matching
Date
Msg-id 398DFBE2.9CC42D45@alumni.caltech.edu
Whole thread Raw
Responses Re: LIKE pattern matching
List pgsql-hackers
I've updated the LIKE code to make it more SQL9x compliant. I've left in
the "permanent backslash" escape character, but I would like to remove
it now.

Here's why:

Usually, we would want to preserve the backward compatibility for a
release or so. But in this case, we have to choose backward
compatibility or SQL9x compliance. I'd rather move toward compliance and
(in this case) a richer feature set. If I leave in the backslash, then
you can't use SQL9x syntax to specify a pattern match which has a
literal backslash in it. So the "one release grace period" means that we
have one more release which does not support the full SQL92 syntax for
this feature.

If I remove the backslash feature, then instead of matching a literal
percent sign ("%") like this:
 ... 'hi%there' LIKE 'hi\%there' ...

you would write
 ... 'hi%there' LIKE 'hi\%there' ESCAPE '\' ...

or of course you could specify another escape character. afaik there is
no default explicit escape character in SQL99.

Comments?
                      - Thomas


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: scp daemon working?
Next
From: Thomas Lockhart
Date:
Subject: Re: OK to remove operators for exp() and ln()