Re: AFTER triggers and constraints - Mailing list pgsql-general

From Vick Khera
Subject Re: AFTER triggers and constraints
Date
Msg-id CALd+dccFb0EkVUfKxcqwn1fTk6uaWHrdnC3pDi1AeEVfQh_CLQ@mail.gmail.com
Whole thread Raw
In response to AFTER triggers and constraints  (David Greco <David_Greco@harte-hanks.com>)
Responses Re: AFTER triggers and constraints  (David Greco <David_Greco@harte-hanks.com>)
List pgsql-general

On Fri, Jun 28, 2013 at 8:45 AM, David Greco <David_Greco@harte-hanks.com> wrote:

The last delete statement will throw a referential integrity error. In Oracle, same example, it does not as the trigger deletes the child.


Not sure your real case, but why not just make the FK on delete cascade and get rid of your trigger entirely?

Alternatively, what if you make your constratint initially deferred?

pgsql-general by date:

Previous
From: Christoph Berg
Date:
Subject: Re: Why are there no inequality scans for ctid?
Next
From: David Greco
Date:
Subject: Re: AFTER triggers and constraints