Re: Dependancies on Tables

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Bryan Zera <Bryanz(at)pollstar(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Dependancies on Tables
Date: 2003-06-26 20:02:54
Message-ID: 20030626200254.GA10205@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 26, 2003 at 12:44:10 -0700,
Bryan Zera <Bryanz(at)pollstar(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message btober 2003-06-26 20:03:20 Re: How many fields in a table are too many
Previous Message Jay O'Connor 2003-06-26 19:49:11 deleting procs