Re: Foreign Key Constraint Deletion Order

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: <cnliou(at)eurosport(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Foreign Key Constraint Deletion Order
Date: 2001-11-19 02:01:20
Message-ID: 20011118175857.C40879-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 19 Nov 2001 cnliou(at)eurosport(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Roland Roberts 2001-11-19 03:57:05 Re: [SQL] PL/pgSQL examples NOT involving functions
Previous Message cnliou 2001-11-19 00:30:25 Foreign Key Constraint Deletion Order