Re: Prevent from Deletion

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Alex <alex(at)meerkatsoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Prevent from Deletion
Date: 2003-09-01 03:29:52
Message-ID: m3isodb2z3.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alex <alex(at)meerkatsoft(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hal Vorlee 2003-09-01 03:34:12 XA Resource Manager
Previous Message Martijn van Oosterhout 2003-09-01 03:13:19 Re: About GPL and proprietary software