Re: Uninterruptable regexp_replace in 9.3.1 ?

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Craig Ringer <craig(at)2ndQuadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Sandro Santilli <strk(at)keybit(dot)net>
Subject: Re: Uninterruptable regexp_replace in 9.3.1 ?
Date: 2014-02-21 16:56:04
Message-ID: 6EF2A961-79C6-470B-BC2C-AA6061D07CE4@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Feb21, 2014, at 17:29 , Craig Ringer <craig(at)2ndQuadrant(dot)com> wrote:
> The problem report claims that the issue does not occur on 9.1, but yet:
>
> git diff REL9_1_STABLE master -- ./src/backend/utils/adt/regexp.c
>
> is utterly trivial; a copyright date line change, and 1609797c which
> just tweaks the includes. 9.0 has a much bigger diff.

On 9.1.12:

postgres=# select regexp_matches(' $a$b$c$d$e$f$g$h$i$j$',
$REG$((?:[^'"$;]+|"[^"]*"|'(?:[^']*|'')*'|(\$[^$]*\$).*\2)+)$REG$, 'g');
regexp_matches
---------------------------------------------
{" $a$b$c$d$e$f$g$h$i$j",NULL}
(1 row)
Time: 1.048 ms

On HEAD

postgres=# select regexp_matches(' $a$b$c$d$e$f$g$h$i$j$',
$REG$((?:[^'"$;]+|"[^"]*"|'(?:[^']*|'')*'|(\$[^$]*\$).*\2)+)$REG$, 'g');
regexp_matches
-------------------------
{" ",NULL}
{a,NULL}
{b,NULL}
{c,NULL}
{d,NULL}
{e,NULL}
{f,NULL}
{g,NULL}
{h,NULL}
{i,NULL}
{j,NULL}
(11 rows)
Time: 4787.239 ms

Aha! Since we go rid of regex_flavor pre-9.1, I don't have an immediate suspect...

best regards,
Florian Pflug

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-02-21 17:03:33 Re: Uninterruptable regexp_replace in 9.3.1 ?
Previous Message Craig Ringer 2014-02-21 16:29:33 Re: Uninterruptable regexp_replace in 9.3.1 ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-02-21 17:03:33 Re: Uninterruptable regexp_replace in 9.3.1 ?
Previous Message Craig Ringer 2014-02-21 16:49:17 Re: Storing the password in .pgpass file in an encrypted format