Re: preventing deletion of a row

From: Kenneth Gonsalves <lawgon(at)thenilgiris(dot)com>
To: Nick Johnson <arachnid(at)notdot(dot)net>
Cc: PostgreSQL SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: preventing deletion of a row
Date: 2005-06-07 06:43:37
Message-ID: 200506071213.37155.lawgon@thenilgiris.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kenneth Gonsalves 2005-06-07 07:00:16 to listadmin
Previous Message Volkan YAZICI 2005-06-07 06:41:22 Re: large object support in PostGres 7.4