Re: uninterruptable regexp_replace in 9.2 and 9.3 - Mailing list pgsql-bugs

From Pedro Gimeno
Subject Re: uninterruptable regexp_replace in 9.2 and 9.3
Date
Msg-id 53132D11.2010305@personal.formauri.es
Whole thread Raw
In response to Re: uninterruptable regexp_replace in 9.2 and 9.3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote, On 2014-03-02 05:38:

> The performance problem we're looking at comes directly from the
> backtracking that's done to ensure that we detect a match in case the
> pattern has this sort of pathological behavior.

It is my understanding that the bug reported by the OP is not a
performance problem, but PostgreSQL's failure to interrupt the
processing if it takes too long, when statement_timeout is set.

If it's not possible to interrupt it, then maybe an approach similar to
PHP's backtracking limit could be implemented.

I'm not familiar at all with PostgreSQL's code, but I wonder if adding a
CHECK_FOR_INTERRUPTS every sensible number of backtracks could solve the
original bug.

pgsql-bugs by date:

Previous
From: Sandro Santilli
Date:
Subject: Re: uninterruptable regexp_replace in 9.2 and 9.3
Next
From: pboake@gmail.com
Date:
Subject: BUG #9416: Setting up postgresql-9.1 (9.1.12-0wheezy1) Fails Configuration