From: Litao Wu <litaowu@yahoo.com>
To: pgsql-performance@postgresql.org
Subject: insert waits for delete with trigger
Date: Mon, 9 Aug 2004 17:05:59 -0700 (PDT)
Message-ID: <20040810000559.91562.qmail@web13121.mail.yahoo.com> (raw)
Hi all,
We have table q_20040805 and a delete trigger on
it. The delete trigger is:
update table q_summary set count=count-1...
When we delete from q_20040805, we also insert into
related info q_process within the same
transaction. There is a PK on q_process, but no
trigger on it. No FK on either of the 3 tables.
Here is info from pg_lock:
relname | pid | mode |
granted | current_query
-------------------+-------+------------------+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
q_process | 14643 | RowExclusiveLock | t |
DELETE FROM q_20040805 WHERE domain_id='20237906' AND
module='spam'
q_summary | 14643 | RowExclusiveLock | t |
DELETE FROM q_20040805 WHERE domain_id='20237906' AND
module='spam'
q_20040805 | 14643 | RowExclusiveLock | t |
DELETE FROM q_20040805 WHERE domain_id='20237906' AND
module='spam'
q_process | 18951 | RowExclusiveLock | t |
INSERT INTO q_process (...) SELECT ... FROM q_20040805
WHERE domain_id='20237906' AND module='spam'
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-performance@postgresql.org
Cc: litaowu@yahoo.com
Subject: Re: insert waits for delete with trigger
In-Reply-To: <20040810000559.91562.qmail@web13121.mail.yahoo.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