Re: Dependancies on Tables - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Dependancies on Tables
Date
Msg-id 20030626200254.GA10205@wolff.to
Whole thread Raw
In response to Dependancies on Tables  ("Bryan Zera" <Bryanz@pollstar.com>)
List pgsql-general
On Thu, Jun 26, 2003 at 12:44:10 -0700,
  Bryan Zera <Bryanz@pollstar.com> wrote:
>
> Originally, I thought I would just add triggers/functions to the
> related tables so that if someone tried to delete them, it would not
> allow the user to delete.  But then I realized that if I added a
> trigger/function combination to the related tables that prevents
> deletion, the functions that are triggered by the user deletion would
> also be blocked from deleting from that table.

Can't the trigger check to see if the user record is still there and
only block the deletion if it is?

You will also want an update trigger to make sure the user field
can't be changed.

pgsql-general by date:

Previous
From:
Date:
Subject: Re: How many fields in a table are too many
Next
From: Mikhail Terekhov
Date:
Subject: Re: PlPython