Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group