Re: [GENERAL] Disabling triggers in a transaction

2005-03-13 Thread Adam Tomjack
Bruce Momjian wrote: Geoffrey wrote: Terry Lee Tucker wrote: Tom, Do you feel this is a safe method for disabling triggers in the rare cases where one finds that it is prudent to do that? Do you think that the column, reltriggers, is permanent fixture in pg_class? What is your advice on this?

Re: [GENERAL] Disabling triggers in a transaction

2005-03-10 Thread Alban Hertroys
I just got this rather wild idea, don't really have the opportunity to think it through thoroughly right now... Say, you create a table with a set of triggers that have some method of checking whether triggers should be enabled in this session, and containing some stubs where actual trigger

Re: [GENERAL] Disabling triggers in a transaction

2005-03-09 Thread Alban Hertroys
Net Virtual Mailing Lists wrote: 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

Re: [GENERAL] Disabling triggers in a transaction

2005-03-09 Thread Net Virtual Mailing Lists
Net Virtual Mailing Lists wrote: 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;

Re: [GENERAL] Disabling triggers in a transaction

2005-03-09 Thread Adam Tomjack
[Here's my third attempt to post this. Sorry if it's a dup. (trip?)] If you're willing to modify your triggers you can gain per-session control over any and all triggers and functions. For example, suppose I have a trigger that logs certain events, but I also want to be able to turn off

Re: [GENERAL] Disabling triggers in a transaction

2005-03-08 Thread Bruce Momjian
Geoffrey wrote: Terry Lee Tucker wrote: Tom, Do you feel this is a safe method for disabling triggers in the rare cases where one finds that it is prudent to do that? Do you think that the column, reltriggers, is permanent fixture in pg_class? What is your advice on this?

Re: [GENERAL] Disabling triggers in a transaction

2005-03-08 Thread Net Virtual Mailing Lists
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

Re: [GENERAL] Disabling triggers in a transaction

2005-03-03 Thread Terry Lee Tucker
This caught my eye the other day, but didn't take the time to examine it. I find that I am now very interested in it. Could you please elaborate on your method and how this works? TIA On Sunday 27 February 2005 05:37 pm, Jay Guerette saith: If I disable INSERT and UPDATE triggers inside a

Re: [GENERAL] Disabling triggers in a transaction

2005-03-03 Thread Terry Lee Tucker
Tom, Do you feel this is a safe method for disabling triggers in the rare cases where one finds that it is prudent to do that? Do you think that the column, reltriggers, is permanent fixture in pg_class? What is your advice on this? TIA On Monday 28 February 2005 03:22 pm, Tom Lane saith:

Re: [GENERAL] Disabling triggers in a transaction

2005-03-03 Thread Geoffrey
Terry Lee Tucker wrote: Tom, Do you feel this is a safe method for disabling triggers in the rare cases where one finds that it is prudent to do that? Do you think that the column, reltriggers, is permanent fixture in pg_class? What is your advice on this? I'd be quite interested in this as

[GENERAL] Disabling triggers in a transaction

2005-02-28 Thread Jay Guerette
If I disable INSERT and UPDATE triggers inside a transaction; by setting and resetting reltriggers in pg_class; am I correct in thinking that this will disable triggers globally for that table for the duration of that transaction? So an INSERT or UPDATE to this table, outside of the transaction

Re: [GENERAL] Disabling triggers in a transaction

2005-02-28 Thread Tom Lane
Jay Guerette [EMAIL PROTECTED] writes: If I disable INSERT and UPDATE triggers inside a transaction; by setting and resetting reltriggers in pg_class; am I correct in thinking that this will disable triggers globally for that table for the duration of that transaction? Not if you never commit