>It is the only known way to control triggers though it isn't regularly
>tested by the developers.


I think I've come up with another way.. I posted this recently, but did
not get any feedback on it so I'm not sure how dumb it is...  It is
working really great for me though....


All I did was added an extra column to my table (I called it
"batch_process").  Then in
the trigger do something like (in whichever function you are calling):

IF NEW.batch_update IS NOT NULL AND NEW.batch_update = ''t'' THEN
  NEW.batch_process := NULL;
  RETURN NULL;
END IF;
.. whatever the rest of transaction is


Then when doing an insert, just:

INSERT INTO table (..., batch_process) VALUES (..., 't') when you want the
trigger not to fire...

Or an update:

UPDATE TABLE table SET ...., batch_process = 't' ....


I'm not sure sure how to make it work on a function called from a delete
trigger though.. ;-(

- Greg


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to