Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 383A747663F for ; Sat, 12 Oct 2002 10:57:39 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id BD1D5476611 for ; Sat, 12 Oct 2002 10:57:38 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C5FE8D611; Sat, 12 Oct 2002 07:57:39 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id BBAE45C02; Sat, 12 Oct 2002 07:57:39 -0700 (PDT) Date: Sat, 12 Oct 2002 07:57:39 -0700 (PDT) From: Stephan Szabo To: Bhuvan A Cc: Subject: Re: DELETE command is getting blocked In-Reply-To: Message-ID: <20021012075552.C45930-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/145 X-Sequence-Number: 9862 On Sat, 12 Oct 2002, Bhuvan A wrote: > I am using 7.2. > > I have problem in deleting records from a particular table in my database. > Say, if the DELETE command results deleting 10 records, the command is > blocked at the end and is not returning. FYI, that table donot have any > triggers/constraints/rules on delete. I have checked whether its due to > the same table access by some other client, but it is not so. No other > process is accessing this table by that time. > > Infact i am able to repeat the problem. To make sure, i wrote a plpgsql > and tried deleting these 10 records one by one in a for loop. There too it > is blocked for infinite time, after deleting the last record. what would > be the problem? Is the table corrupted? > > FYI, table has a primary key which is referred from different tables. > Anyhow i have deleted records from foreign key tables, before deleting > from the primary key table. If it's referred from other tables, then it does have triggers on delete. It's probably the constraint trigger that's blocking, but that should only occur if something was modifying one of the foreign key tables at the same time. You might want to turn on query logging to get a good idea of what's going on.