Re: trigger question - Mailing list pgsql-general

From A. Kretschmer
Subject Re: trigger question
Date
Msg-id 20070119065235.GC26274@a-kretschmer.de
Whole thread Raw
In response to trigger question  ("Furesz Peter" <fureszpeter@srv.hu>)
List pgsql-general
am  Tue, dem 16.01.2007, um 18:35:56 +0100 mailte Furesz Peter folgendes:
> Hello,
>
> I have a table named foobar  and I don't want to allow from DELETE or
> UPDATE its rows.
>
> I have a table as described below:
> foobar(foobar_id, value, is_deleted);
>
> I don't want to allow directly delete or modify the table's rows. I plan to
> make an on before update or delete trigger and
> on delete action I update the actual row is_deleted flag, on UPDATE action

I think, you should better use a RULE for this:

http://www.postgresql.org/docs/8.2/interactive/rules.html


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-general by date:

Previous
From: Chris
Date:
Subject: Re: help me to solve the problem
Next
From: Devrim GUNDUZ
Date:
Subject: Re: uninstalling postgre sql on Fedora core 5