Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Disable Trigger...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 10 Topic 15230 of 17602
Post > Topic >>

Disable Triggers

by terry@[EMAIL PROTECTED] (Terry Lee Tucker) Apr 9, 2008 at 10:34 AM

Greetings:

I have a situation where an external process needs to disable the firing
of 
triggers on a table. I have two backend functions which handle this task:
disable_triggers ('table_name')
enable_triggers ('table_name')

These functions are called inside a transaction. The first, stores various

attributes of the triggers in a secondary table, then updates pg_trigger 
setting tgenabled to 'D'. The second restores the value of tgenabled from
the 
secondary table and then deletes the records from the secondary table. 

I can begin a transaction withing psql, issue: SELECT disable_triggers 
('cust'), make an update to cust and the before and after triggers all
fire 
just like normal. I can do a \d cust inside the same transaction and the 
triggers sections is listed with the heading: "Disabled Triggers". I can
look 
at the pg_trigger records associated with the cust table, and tgenabled is

set to "D", but the triggers still fire. session_replication_role is set
to 
"origin". I thought this was supposed to be fixed in later versions of 
Postgres (I'm converting from 7.4.19 to 8.3.1), so apparently I'm missing 
something.

Does anyone have any insight?

TIA
-- 
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 404-6987
terry@[EMAIL PROTECTED]
 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 10 Posts in Topic:
Disable Triggers
terry@[EMAIL PROTECTED]   2008-04-09 10:34:06 
Re: Disable Triggers
greg@[EMAIL PROTECTED] (  2008-04-09 15:00:00 
Re: Disable Triggers
terry@[EMAIL PROTECTED]   2008-04-09 11:15:55 
Re: Disable Triggers
terry@[EMAIL PROTECTED]   2008-04-09 12:37:24 
Re: Disable Triggers
tgl@[EMAIL PROTECTED] (T  2008-04-09 13:12:30 
Re: Disable Triggers
terry@[EMAIL PROTECTED]   2008-04-09 13:46:59 
Re: Disable Triggers
greg@[EMAIL PROTECTED] (  2008-04-09 18:56:48 
Re: Disable Triggers
lists@[EMAIL PROTECTED]   2008-04-09 15:08:59 
Re: Disable Triggers
tgl@[EMAIL PROTECTED] (T  2008-04-09 16:38:54 
Re: Disable Triggers
terry@[EMAIL PROTECTED]   2008-04-09 18:29:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:45:57 CST 2008.