Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WKRL5-0007Cb-HQ for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Mar 2014 11:47:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WKRL4-00085j-IG for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Mar 2014 11:47:18 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WK67K-0002DF-3n for pgsql-bugs@postgresql.org; Sun, 02 Mar 2014 13:07:42 +0000 Received: from formauri.es ([78.47.205.180]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WK67C-0005EL-B7 for pgsql-bugs@postgresql.org; Sun, 02 Mar 2014 13:07:41 +0000 Received: from [0.0.0.0] (formauri.es [78.47.205.180]) by formauri.es (Postfix) with ESMTPS id 0754882E56; Sun, 2 Mar 2014 14:07:30 +0100 (CET) Message-ID: <53132D11.2010305@personal.formauri.es> Date: Sun, 02 Mar 2014 14:07:29 +0100 From: Pedro Gimeno User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130704 Icedove/17.0.7 MIME-Version: 1.0 To: Tom Lane CC: Sandro Santilli , pgsql-bugs@postgresql.org Subject: Re: uninterruptable regexp_replace in 9.2 and 9.3 References: <20140228112858.GE5011@localhost> <5310925B.8010809@personal.formauri.es> <17158.1393735118@sss.pgh.pa.us> In-Reply-To: <17158.1393735118@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs