From: Kenneth Gonsalves <lawgon@thenilgiris.com>
To: Nick Johnson <arachnid@notdot.net>
Cc: PostgreSQL SQL <pgsql-sql@postgresql.org>
Subject: Re: preventing deletion of a row
Date: Tue, 7 Jun 2005 12:13:37 +0530
Message-ID: <200506071213.37155.lawgon@thenilgiris.com> (raw)
In-Reply-To: <42A537B6.8040902@notdot.net>
References: <200506071059.17689.lawgon@thenilgiris.com>
<42A537B6.8040902@notdot.net>
On Tuesday 07 Jun 2005 11:29 am, Nick Johnson wrote:
> >if the value of 'fixed' is TRUE, then this row cannot be deleted.
> > How do i enforce this condition?
> >
>
> Try this:
> CREATE RULE tablename_delete AS ON DELETE TO tablename WHERE
> OLD.fixed = TRUE DO INSTEAD NOTHING;
cool - thanks
--
regards
kg
http://www.livejournal.com/users/lawgon
tally ho! http://avsap.sourceforge.net
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: lawgon@thenilgiris.com, arachnid@notdot.net
Subject: Re: preventing deletion of a row
In-Reply-To: <200506071213.37155.lawgon@thenilgiris.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox