Re: Trigger disactivation and SELECT WAITING

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Philippe Lang" <philippe(dot)lang(at)attiksystem(dot)ch>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger disactivation and SELECT WAITING
Date: 2005-07-26 17:56:51
Message-ID: 17066.1122400611@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Philippe Lang" <philippe(dot)lang(at)attiksystem(dot)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. So insertions 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-07-26 17:58:37 Re: transaction timeout
Previous Message Dr NoName 2005-07-26 17:51:16 Re: transaction timeout