On 10/13/2011 5:45 PM, David Johnston wrote:
> the company record should not be visible
> if you execute a SELECT against the companies table using the given
> company_id value. The previous is not tested and I am not totally sure
> about the visibility rules in this situation (mainly whether the
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Robert Fitzpatrick
Sent: Thursday, October 13, 2011 4:39 PM
To: PostgreSQL
Subject: [GENERAL] Test for cascade delete in plpgsql
My contacts table has a FK with cascade
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 th