LIKE pattern matching

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: LIKE pattern matching
Date: 2000-08-06 23:59:30
Message-ID: 398DFBE2.9CC42D45@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-08-07 00:00:19 Re: OK to remove operators for exp() and ln()
Previous Message vectro 2000-08-06 21:36:19 Re: [HACKERS] Re: Trouble with float4 afterupgrading from 6.5.3 to 7.0.2