Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGmFH-0006EV-3o for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2014 09:18:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGmFG-000162-Ao for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2014 09:18:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGmFD-00015q-JY for pgsql-hackers@postgresql.org; Fri, 21 Feb 2014 09:18:07 +0000 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGmFA-0007pM-Iq for pgsql-hackers@postgresql.org; Fri, 21 Feb 2014 09:18:06 +0000 Received: by mail-ea0-f179.google.com with SMTP id q10so1431329ead.24 for ; Fri, 21 Feb 2014 01:18:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mail-followup-to :mime-version:content-type:content-disposition :content-transfer-encoding:user-agent; bh=UCiqzFEA/UwmlYO0GQNDIxJKo/pd0slKJopKSdqTzko=; b=AKaU4/2zpXYT1ra8voaY+PqXuJ4ZgChxvjT7M2rOlSE9BsxCV4Pua7Brj81+os1Mmz wJ2NSeHc6QKmMyeYkvaLdlPlu0KG/jOL0jDZ6vKkMD/wCgIlUkcHos6ET5yeJRE8hJ6D wMrVK0zFsMkitfnZTo5f8wNXvRLxmCg1DqdHfae4mq/3kNtUNLWbJh9ipAQXFI8U2hMc tc49ypV+QT0cXqzrs0qv+TRMCD3IsRfexvFFd9fdTidg7ZJ63XGw5c9DaLwC+aPjd/OH JBilbcTqZzSFa9Gr9qgS/BMM5HbdnOeGIrpZUVwY/C8qNRty+9r/LaiMYy0VKW2IPnJJ 3UXA== X-Received: by 10.14.99.196 with SMTP id x44mr7118447eef.65.1392974283258; Fri, 21 Feb 2014 01:18:03 -0800 (PST) Received: from localhost (ip-46-232-148-34.static.adsl.cheapnet.it. [46.232.148.34]) by mx.google.com with ESMTPSA id m9sm24270930eeh.3.2014.02.21.01.18.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 01:18:02 -0800 (PST) Date: Fri, 21 Feb 2014 10:17:59 +0100 From: Sandro Santilli To: pgsql-hackers@postgresql.org Subject: Uninterruptable regexp_replace in 9.3.1 ? Message-ID: <20140221091759.GK6924@localhost> Mail-Followup-To: pgsql-hackers@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org The following snippet reveals that 9.3.1 has a bug in regexp_matches, which uninterruptably keeps CPU spinning for minutes: -----8<--------------------------------------------------- \timing SET statement_timeout = 2; -- this is only to show statement_timeout is effective here SELECT count(*) from generate_series(1, 100000); -- this one is uninterruptable! SELECT regexp_matches($INPUT$ /a $b$ $c$d ; $INPUT$, $REG$((?:[^'"$;]+|"[^"]*"|'(?:[^']*|'')*'|(\$[^$]*\$).*?\2)+)$REG$, 'g' ); -----8<--------------------------------------------------- The above has been tested to be harmless with PostgreSQL 9.1.11 in that the regexp_matches call is interrupted, but it is NOT with PostgreSQL 9.3.1. Is it a known bug ? Please include my address in replies as I don't get notified of list activity. Thanks. --strk; ()  ASCII ribbon campaign -- Keep it simple ! /\  http://strk.keybit.net/rants/ascii_mails.txt -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers