pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: Robert Schreiber <bobschreiber@charter.net>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
Date: Sat, 11 May 2019 23:50:43 -0400
Message-ID: <27602.1557633043@sss.pgh.pa.us> (raw)
In-Reply-To: <87mujsgz14.fsf@news-spur.riddles.org.uk>
References: <785708a0-a64c-42ee-9173-f596c1fc92ec@manitou-mail.org>
	<32565.1557590361@sss.pgh.pa.us>
	<87mujsgz14.fsf@news-spur.riddles.org.uk>

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





view thread (12+ messages)  latest in thread

Message-ID: <27602.1557633043@sss.pgh.pa.us>
Permalink:  ../27602.1557633043@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27602.1557633043@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, daniel@manitou-mail.org, bobschreiber@charter.net
  Subject: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
  In-Reply-To: <27602.1557633043@sss.pgh.pa.us>
  References: <785708a0-a64c-42ee-9173-f596c1fc92ec@manitou-mail.org> <32565.1557590361@sss.pgh.pa.us> <87mujsgz14.fsf@news-spur.riddles.org.uk> <27602.1557633043@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox