Re: RELAX! - or more to the point, how do I temporarily relax a trigger/constraint? - Mailing list pgsql-general

From Tom Lane
Subject Re: RELAX! - or more to the point, how do I temporarily relax a trigger/constraint?
Date
Msg-id 24855.995567751@sss.pgh.pa.us
Whole thread Raw
In response to RELAX! - or more to the point, how do I temporarily relax a trigger/constraint?  ("Howard Williams" <howieshouse@home.com>)
List pgsql-general
"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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: many tables in db
Next
From: "Keith G. Murphy"
Date:
Subject: Interesting discussion