Re: [GENERAL] Trigger error

2009-04-17 Thread sub_woofer
Hi Thank you both for your responses and apologies for the late reply! Tom you were correct! :) I split the If statements into 2 for the old and new tests and it all worked! :) Thanks once again for all your help! :) t. Tom Lane-2 wrote: > > sub_woofer writes: >> IF (((TG_OP = 'INSERT') AND

Re: [GENERAL] Trigger error

2009-04-15 Thread Adrian Klaver
- "sub_woofer" wrote: > Hi All > > Its been some time since I did any work using triggers/pgsql and when > I did, > it was pretty much basic stuff. Ive now returned to developing apps > using > postgres and have run into an error when using a trigger that I wrote > a few > years back (wh

Re: [GENERAL] Trigger error

2009-04-15 Thread Tom Lane
sub_woofer writes: > IF (((TG_OP = 'INSERT') AND (new.subjects=TRUE)) OR ((TG_OP='UPDATE') AND > (new.subjects=TRUE) AND (old.subjects=FALSE))) THEN You can't do that. Split the IF apart so that you don't touch NEW or OLD in the same if-test that tries to determine if they're safe to touch.