Re: Prevent from Deletion - Mailing list pgsql-general

From Doug McNaught
Subject Re: Prevent from Deletion
Date
Msg-id m3isodb2z3.fsf@varsoon.wireboard.com
Whole thread Raw
In response to Prevent from Deletion  (Alex <alex@meerkatsoft.com>)
Responses Re: Prevent from Deletion  (Csaba Nagy <nagy@ecircle-ag.com>)
List pgsql-general
Alex <alex@meerkatsoft.com> writes:

> Hi,
> I have tables that have default records that must not be deleted or
> modified.
> Is there an easy way to do this. Like setting a trigger on the Primary
> key value ?

You could do this--create ON UPDATE and ON DELETE triggers that look
for distinguishing features of the default records (primary key value
or whatever) and RAISE ERROR if they match.  They'll be executed for
every UPDATE and DELETE on the table, which may or may not be a
performance issue for you...

-Doug

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: About GPL and proprietary software
Next
From: mgarriss
Date:
Subject: Getting last inserted SERIAL