Received: from megazone.bigpanda.com ([63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAJ9Q7m55183 for ; Mon, 19 Nov 2001 04:26:07 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 472C1D5E6; Mon, 19 Nov 2001 01:26:08 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 3CDDD5BE6; Mon, 19 Nov 2001 01:26:08 -0800 (PST) Date: Mon, 19 Nov 2001 01:26:08 -0800 (PST) From: Stephan Szabo To: Cc: Subject: Re: Foreign Key Constraint Deletion Order In-Reply-To: <200111190717.3b63@lh00.opsion.fr> Message-ID: <20011119011353.M43437-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200111/265 X-Sequence-Number: 5647 On Mon, 19 Nov 2001 cnliou@eurosport.com wrote: > Then I am in big big trouble! Please imagine a very > usual scenario: > [example snipped] I think you can do this as part of a trigger on PurchaseMaster and something that doesn't do the subtraction if the subselect returns a NULL in the detail trigger (or subtracts 0), not as pretty, but it should function. The master trigger would subtract as necessary for the details for the user.