Search Postgresql Archives

Disable Triggers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx
www.turbocorp.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux