am Mon, dem 03.03.2008, um 15:47:58 +0200 mailte Szentpali Janos
folgendes:
> Hi!
>
> I want to prevent any changes to a tuple if a field of the tuple has a
> certain value. Let's say I have a table with column col_1, col_2, col_3.
> I want to create something that will prevent updating col_2 and col_3 if
> and only if col_1 is say "1".
> Can I use a rule to do that. Can I somehow detect in a trigger function
I think, a RULE isn't the solution, but you can use a BEFORE UPDATE -
Trigger to check if OLD.col_1 = 1 and, in this case, RAISE an error.
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
--
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your Subscription:
http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=pgsql-novice


|