From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Zouroudis <mzouroudis@idealcorp.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: delete with referential integrity
Date: Thu, 29 Aug 2002 13:37:31 -0400
Message-ID: <19787.1030642651@sss.pgh.pa.us> (raw)
In-Reply-To: <3D6E51BF.1010406@idealcorp.com>
References: <3D6E51BF.1010406@idealcorp.com>
Michael Zouroudis <mzouroudis@idealcorp.com> writes:
> because of integrity constraints, i have to
> delete the record from book_asset, then book, and finally assets. all
> inserts, updates, and deletes are done through the assets table, and i
> have a trigger on assets that first deletes book_asset, then books, and
> finally assets. the problem is when it deletes assets on that third
> delete, it sends the db into a recursive loop(the delete on assets
> starts the trigger again).
Why don't you simply let the system carry on with the deletion that the
trigger was called for?
Seems to me the answer to the problem "my trigger is infinitely
recursive" is "make your trigger not recurse".
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, mzouroudis@idealcorp.com
Subject: Re: delete with referential integrity
In-Reply-To: <19787.1030642651@sss.pgh.pa.us>
References: <3D6E51BF.1010406@idealcorp.com> <19787.1030642651@sss.pgh.pa.us>
* 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