Re: Minor regexp bug

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Minor regexp bug
Date: 2015-11-07 03:57:11
Message-ID: CAKFQuwZv-+z6CMrSk501xSQ+Uh8sifhuKzcgB=72M2doC-m0OQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 6, 2015 at 7:32 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> What I'm wondering about is whether to back-patch this. It's possible
> that people have written patterns like this and not realized that they
> aren't doing quite what's expected. Getting a failure instead might not
> be desirable in a minor release. On the other hand, wrong answers are
> wrong answers.
>

​I'd vote to back-patch this. The unscientific reason on my end is that I
suspect very few patterns in the wild would be affected and furthermore any
using such patterns is likely to be in a position to change it match the
existing behavior by replace the "(\1)" with the corresponding "(\w)" as
you used in you example. We should probably suggest just that in the
release notes. It is not a strongly held position and my first reaction
was that introducing an error should be avoided. But regular expressions
are tricky enough to get right when the engine does what you tell it...

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-11-07 04:03:31 Re: ALTER INDEX...SET tab completion
Previous Message Amit Kapila 2015-11-07 03:28:55 Re: Bitmap index scans use of filters on available columns