Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 34E1347672C for ; Thu, 29 Aug 2002 13:38:22 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 73388476726 for ; Thu, 29 Aug 2002 13:38:21 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g7THbVZM019788; Thu, 29 Aug 2002 13:37:31 -0400 (EDT) To: Michael Zouroudis Cc: pgsql-admin@postgresql.org Subject: Re: delete with referential integrity In-reply-to: <3D6E51BF.1010406@idealcorp.com> References: <3D6E51BF.1010406@idealcorp.com> Comments: In-reply-to Michael Zouroudis message dated "Thu, 29 Aug 2002 12:54:23 -0400" Date: Thu, 29 Aug 2002 13:37:31 -0400 Message-ID: <19787.1030642651@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/359 X-Sequence-Number: 5473 Michael Zouroudis 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