RELAX! - or more to the point, how do I temporarily relax a trigger/constraint?

Started by Howard Williamsover 24 years ago2 messagesgeneral
Jump to latest
#1Howard Williams
howieshouse@home.com

I need to programatically relax a constraint during db syncronization. I
tried setting tgenabled to false in the pg_trigger table, but it didn't seem
to make a difference.

Thx,

Howie

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Howard Williams (#1)
Re: RELAX! - or more to the point, how do I temporarily relax a trigger/constraint?

"Howard Williams" <howieshouse@home.com> writes:

I need to programatically relax a constraint during db syncronization. I
tried setting tgenabled to false in the pg_trigger table, but it didn't seem
to make a difference.

Hmm --- I see where trigger.c pays attention to tgenabled for BEFORE
triggers, but it seems to omit to check for AFTER triggers. Given that
there's no feature anywhere in the system to set the field FALSE, I can
see how the oversight escaped notice :-(.

If you are talking about BEFORE triggers, another possible theory is
that your manual update isn't propagating to the relcache entry
where the triggers are stored. If you start a new session (backend)
after making the change, does it honor the tgenabled setting?

regards, tom lane