Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Scott Marlowe
On 8/21/07, Jon Collette <[EMAIL PROTECTED]> wrote: > I think this will work for what I need. I have been messing around with > this using select into > > /select True as donothing into temporary table table_trigger_name; > then run statement that I want to be ignored > / > The trigger would have

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Jon Collette
I think this will work for what I need. I have been messing around with this using select into /select True as donothing into temporary table table_trigger_name; then run statement that I want to be ignored / The trigger would have a select upon the table_trigger_name to determine if it should

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Jon Collette
Good Idea. However some of my triggers use the DELETE action as well. So I can't use this method. Thomas Kellerer wrote: Jon Collette wrote on 21.08.2007 23:26: Is it possible to run an insert,update, or delete and have it not launch a trigger like it normally would? For example could I se

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Thomas Kellerer
Jon Collette wrote on 21.08.2007 23:26: Is it possible to run an insert,update, or delete and have it not launch a trigger like it normally would? For example could I set a value DONOTRUN = True; insert into contacts Where the trigger on contacts would call a function that would have an

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Scott Marlowe
On 8/21/07, Jon Collette <[EMAIL PROTECTED]> wrote: > Is it possible to run an insert,update, or delete and have it not launch > a trigger like it normally would? > > For example could I set a value > DONOTRUN = True; > insert into contacts The closest thing to a session variable for pgsql is

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Jon Collette
Thanks for the reply. It looks like this will disable the trigger for all connections to the database. So if the chance occured that another connection was using the table at the same time it wouldn't launch the trigger either? am I wrong? I hope so ;) Rodrigo De León wrote: On 8/21/07, Jo

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Rodrigo De León
On 8/21/07, Jon Collette <[EMAIL PROTECTED]> wrote: > Is it possible to run an insert,update, or delete and have it not launch > a trigger like it normally would? alter table disable trigger ... http://www.postgresql.org/docs/8.2/static/sql-altertable.html ---(end of broa

[SQL] Make a SQL statement not run trigger

2007-08-21 Thread Jon Collette
Is it possible to run an insert,update, or delete and have it not launch a trigger like it normally would? For example could I set a value DONOTRUN = True; insert into contacts Where the trigger on contacts would call a function that would have an IF statment for that DONOTRUN value? Or