pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Bhuvan A <bhuvansql@myrealbox.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: DELETE command is getting blocked
Date: Sat, 12 Oct 2002 07:57:39 -0700 (PDT)
Message-ID: <20021012075552.C45930-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0210121630001.3869-100000@Bhuvan.bksys.co.in>


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.




view thread (2+ messages)

Message-ID: <20021012075552.C45930-100000@megazone23.bigpanda.com>
Permalink:  ../20021012075552.C45930-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20021012075552.C45930-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, bhuvansql@myrealbox.com
  Subject: Re: DELETE command is getting blocked
  In-Reply-To: <20021012075552.C45930-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox