Disable Triggers

Поиск
Список
Период
Сортировка
От Terry Lee Tucker
Тема Disable Triggers
Дата
Msg-id 200804091034.06855.terry@chosen-ones.org
обсуждение исходный текст
Ответы Re: Disable Triggers
Список pgsql-general
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@turbocorp.com
www.turbocorp.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: select statement fails
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: connecting VB to postgreSQL