Received: from megazone.bigpanda.com ([63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAJ21Hm07189 for ; Sun, 18 Nov 2001 21:01:17 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id D8540D5E6; Sun, 18 Nov 2001 18:01:20 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id CC01A5BE6; Sun, 18 Nov 2001 18:01:20 -0800 (PST) Date: Sun, 18 Nov 2001 18:01:20 -0800 (PST) From: Stephan Szabo To: Cc: Subject: Re: Foreign Key Constraint Deletion Order In-Reply-To: <200111190030.197e@lh00.opsion.fr> Message-ID: <20011118175857.C40879-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200111/260 X-Sequence-Number: 5642 On Mon, 19 Nov 2001 cnliou@eurosport.com wrote: > I have found from a small number of tests that > deletions executed by foreign key constraint does NOT > guarantee the detail table to be deleted BEFORE > master table. This makes some of my trigger functions > assocated with the detail table mulfunction because > the trigger function can't find its parent record. The detail table rows are currently deleted at end of statement or end of transaction (based on deferrability). Technically the time is indeterminate in regards to user triggers on the master table. We've been having discussions on hackers about the behavior, but it's unlikely that the rows will be deleted before the master row.