Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
Date
Msg-id 27602.1557633043@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-bugs
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> I looked up the spec on this point. As far as I can see, we're not
> following it, but neither does the spec do what the OP wanted; in fact
> the result should have included the _leading_ Q as well as the trailing
> one.

Huh, interesting.  So we should be translating the initial substring
to a non-greedy pattern.  I believe Spencer's engine can handle that
by sticking (?:...){1,1}? around it.

Come to think of it, we probably need to be putting (?:...) around
the trailing substring as well.  I suspect what we're doing today
produces non-spec results if "|" appears in the trailing part.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
Next
From: Andrew Gierth
Date:
Subject: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug