Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Triggers | rule...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3024 of 3178
Post > Topic >>

Triggers | rules for column updates

by ianus@[EMAIL PROTECTED] (Szentpali Janos) Mar 3, 2008 at 03:47 PM

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 
the name of the columns that are updated? If I could do that, it would 
be easy to create a trigger that would do the job.
I am also opened to other kind of solutions that you might know of.
Any help will be appreciated ;)

-- 
Szentpáli János


--
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
 




 2 Posts in Topic:
Triggers | rules for column updates
ianus@[EMAIL PROTECTED]   2008-03-03 15:47:58 
Re: Triggers | rules for column updates
andreas.kretschmer@[EMAIL  2008-03-03 15:16:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 12:45:58 CDT 2008.