Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A2DB39FBD26 for ; Wed, 25 Jul 2007 17:55:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 75301-07 for ; Wed, 25 Jul 2007 17:55:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from skynet.simkin.ca (skynet.simkin.ca [72.51.27.117]) by postgresql.org (Postfix) with ESMTP id 2FE279FBD1E for ; Wed, 25 Jul 2007 17:55:15 -0300 (ADT) Received: from charon.medialogik.com (charon.medialogik.com [72.51.27.114]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by skynet.simkin.ca (Postfix) with ESMTP id A62FB4A54 for ; Wed, 25 Jul 2007 13:55:13 -0700 (PDT) From: Alan Hodgson Organization: Simkin Network Consulting To: pgsql-performance@postgresql.org Subject: Re: Insert Statements Hanging Date: Wed, 25 Jul 2007 13:55:13 -0700 User-Agent: KMail/1.9.5 References: <46A7B216.2070608@livedatagroup.com> In-Reply-To: <46A7B216.2070608@livedatagroup.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707251355.13174@hal.medialogik.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/355 X-Sequence-Number: 26039 On Wednesday 25 July 2007 13:27, Pallav Kalva wrote: > I am hoping "SELECT 1 FROM ONLY "provisioning"."account" x WHERE > "accountid" = $1 FOR UPDATE OF x" is causing the problem. If that is the > case why doesnt it show in the pg_stat_activity view ? or am I missing > something here ? what would be the reason for insert statement to hang > like that ? It's waiting for a lock, probably on one of the tables that it references for foreign keys. 8.1 or later would have that happen a lot less; they altered the locking requirements for foreign key lookups. -- "It is a besetting vice of democracies to substitute public opinion for law." - James Fenimore Cooper