Re: [GENERAL] disabling triggers, constaints and so on

2008-02-28 Thread Erik Jones
On Feb 25, 2008, at 2:33 PM, Geoffrey wrote: We are still in a pickle with trying to resolve our trigger issues without affecting slony triggers. The point is, we need to be able to disable triggers, check constraints, and foreign-key constraints without affecting slony triggers in certa

[GENERAL] disabling triggers, constaints and so on

2008-02-25 Thread Geoffrey
We are still in a pickle with trying to resolve our trigger issues without affecting slony triggers. The point is, we need to be able to disable triggers, check constraints, and foreign-key constraints without affecting slony triggers in certain situations. This is all running on 7.4.19, thu

Re: [GENERAL] Disabling Triggers

2005-05-11 Thread Alban Hertroys
Mark Borins wrote: I am creating a system where I have a trigger on three different tables. There is a particular Boolean field in each of these tables that when it is set in table it should be set the same in the other two. So I figured I could put a trigger on each table that when the Bool

Re: [GENERAL] Disabling Triggers

2005-05-11 Thread Mark Borins
That looks like a good solution. And that way it won't cascade. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Huxton Sent: May 11, 2005 11:53 AM To: Mark Borins Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Disabling Tri

Re: [GENERAL] Disabling Triggers

2005-05-11 Thread Richard Huxton
Mark Borins wrote: I am creating a system where I have a trigger on three different tables. There is a particular Boolean field in each of these tables that when it is set in table it should be set the same in the other two. Just make sure you only check the boolean value too: -- Trigger on table a

Re: [GENERAL] Disabling Triggers

2005-05-11 Thread Tom Lane
"Mark Borins" <[EMAIL PROTECTED]> writes: > Does anyone know if it is possible to run an update statement on a table and > for only that statement disable the trigger on the table? No, but why fire the update if not needed? Make the trigger do something like UPDATE foo SET boolcol = true

Re: [GENERAL] Disabling Triggers

2005-05-11 Thread Mark Borins
From: Franco Bruno Borghesi [mailto:[EMAIL PROTECTED] Sent: May 11, 2005 11:24 AM To: Mark Borins Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Disabling Triggers You could add a TIMESTAMP field on the three tables (lets call it last_change), and modify your

Re: [GENERAL] Disabling Triggers

2005-05-11 Thread Franco Bruno Borghesi
You could add a TIMESTAMP field on the three tables (lets call it last_change), and modify your triggers to update this value every time a row is updated. Then your trigger should update the boolean fields with the boolean value of the row with the max(last_change) in the three tables, only if the

[GENERAL] Disabling Triggers

2005-05-11 Thread Mark Borins
I am creating a system where I have a trigger on three different tables.  There is a particular Boolean field in each of these tables that when it is set in table it should be set the same in the other two.   So I figured I could put a trigger on each table that when the Boolean field was

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

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 i

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 logging

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 :

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 NUL

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 add

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

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 wel

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

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 c

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