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

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

From
"Howard Williams"
Date:
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



"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