Re: Trigger disactivation and SELECT WAITING - Mailing list pgsql-general

From Tom Lane
Subject Re: Trigger disactivation and SELECT WAITING
Date
Msg-id 17066.1122400611@sss.pgh.pa.us
Whole thread Raw
In response to Re: Trigger disactivation and SELECT WAITING  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
List pgsql-general
"Philippe Lang" <philippe.lang@attiksystem.ch> writes:
> I meant: in 7.4.X databases, is there a way of disabling a trigger without deleting it? I guess the answer is no.

Nothing officially supported, anyway.  There's a pg_trigger.tgenabled
column but I'm not sure which operations pay attention to it.

> That's what my plpgsql insert function does, and because of this, if a view is running at the same moment on the same
tables(some views can take up to 2 hours to be calculated), the insert function gets stuck in a SELECT WAITING state.
Soinsertions are impossible in the database when views are being calculated. 

I guess I question a database design in which you routinely have to drop
triggers in order to get your work done.  Why have the trigger at all if
you do so many changes to the table with it deleted?  Why not improve
the trigger to be smart enough to not interfere with what you need the
insertion function to do?

            regards, tom lane

pgsql-general by date:

Previous
From: Dr NoName
Date:
Subject: Re: transaction timeout
Next
From: Scott Marlowe
Date:
Subject: Re: transaction timeout