Test for cascade delete in plpgsql - Mailing list pgsql-general

From Robert Fitzpatrick
Subject Test for cascade delete in plpgsql
Date
Msg-id 4E974C77.3060402@webtent.org
Whole thread Raw
Responses Re: Test for cascade delete in plpgsql  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
My contacts table has a FK with cascade delete to foreign table
companies using the company_id column.

I have a DELETE AFTER trigger on my contacts table that checks to see if
there are any contacts left with an email address or it won't allow you
to delete the record for a company. However, if the company is being
deleted, is there a way I can test for the cascade delete reason and
have my trigger allow the contact to be deleted?

--Robert

pgsql-general by date:

Previous
From: Evan Walter
Date:
Subject: Re: [ADMIN] Trying to use binary replication - from tutorial
Next
From: Bob Hatfield
Date:
Subject: Re: pg 8.3 replication causing corruption