X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D319C3A3E62 for ; Mon, 8 Nov 2004 14:24:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91496-05 for ; Mon, 8 Nov 2004 14:24:05 +0000 (GMT) Received: from digpala.axelero.hu (fe02.axelero.hu [195.228.240.90]) by svr1.postgresql.org (Postfix) with ESMTP id 4D5FB3A3E5B for ; Mon, 8 Nov 2004 14:24:07 +0000 (GMT) Received: from digpala (localhost-02 [127.0.2.1]) by digpala.axelero.hu (8.12.11/8.12.11) with SMTP id iA8EO68t025279 for ; Mon, 8 Nov 2004 15:24:06 +0100 (CET) Received: from fe02.axelero.hu [127.0.2.1] via SMTP gateway by digpala [195.228.240.90]; id A062AAB062E at Mon, 08 Nov 2004 15:24:05 +0100 Received: from fejleszt4 (121-248-182-81.adsl-fixip.axelero.hu [81.182.248.121]) by fe02.axelero.hu (8.12.11/8.12.11) with SMTP id iA8EO4c1025217 for ; Mon, 8 Nov 2004 15:24:05 +0100 (CET) Message-ID: <003d01c4c59e$2e2d1e70$0403a8c0@fejleszt4> From: =?iso-8859-2?B?U1rbQ1MgR+Fib3I=?= To: References: <012601c4c292$6804b810$0403a8c0@fejleszt4> <26896.1099590388@sss.pgh.pa.us> <011201c4c33b$7bd722c0$0403a8c0@fejleszt4> <013b01c4c347$195212c0$0403a8c0@fejleszt4> <26614.1099670548@sss.pgh.pa.us> Subject: Re: Killed backend won't rollback transaction? Date: Mon, 8 Nov 2004 15:21:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/101 X-Sequence-Number: 9872 Dear Tom, ----- Original Message ----- From: "Tom Lane" Sent: Friday, November 05, 2004 5:02 PM > SIGTERM on individual backends is not recommended or supported. That explains this. Keeping this policy in mind, I wouldn't qualify this as a bug after all. > FWIW, though, I could not duplicate this bug report. Are you sure you > know what the second one was really waiting on? Yeah I'm quite sure. See sample below. Ask for a working example if you wish. The main concept is that a system() call from a C function causes another connection to be opened, and the original connection, after locking the tuple, waits for the other connection (that is started implicitly by the C function) that in turn waits for the locked tuple to be unlocked. Thus, the transactions are "nested" even though they are on a different connection. G. %----------------------- cut here -----------------------% -- table: CREATE TABLE test_id ( id serial NOT NULL PRIMARY KEY, retval varchar ); -- there is a "before insert" trigger that allows retval of existing key -- to be updated instead of inserted if retval is null (see PHP script below) -- plpgsql function: CREATE PROCEDURE test_pl (int) RETURNS varchar AS ' declare rv varchar; begin -- this can be delayed till the PHP call, but keeping here -- helps reproduce the problem. INSERT INTO test_id (id) VALUES ($1); rv := test_c ($1); rv := retval FROM test_id WHERE id = $1; return rv; end; -- C function: text *test_c (int) { ... system ("php -q test.php"); ... } -- PHP script "test.php": \end