Re: Skip trigger? - Mailing list pgsql-general

From hamann.w@t-online.de
Subject Re: Skip trigger?
Date
Msg-id wolfgang-1160501141430.A011479@linux-f7v9
Whole thread Raw
In response to Re: Skip trigger?  (Stephen Cook <sclists@gmail.com>)
List pgsql-general
>> On 2016-04-30 02:08, wolfgang@alle-noten.de wrote:
>> > Hi,
>> >
>> > I have a table with a row update trigger that is quite slow.
>> > The trigger finction basically sets some bits in a "changed" column
>> > depending on which values really changed.
>> > For some bulk updates it can be determined in advance that the
>> > trigger function will not have any effect.
>> > Is there any way to run an update query and specify that it should not
>> > activate the trigger.
>> > I know that I can disable the trigger and reenable it later;
>> > however other concurrent updates mights need it
>>
>>
>> I always disable the trigger, run the update, and enable the trigger
>> within a transaction. This locks the table and will prevent other
>> sessions from doing updates without the trigger (I run it during
>> off-hours if it is going to take more time than is acceptable).
>>
Hi Stephen,
this is what I do now occasionally. However, I would like to be able to run some things right away.
The solutions in http://blog.endpoint.com/2015/07/selectively-firing-postgres-triggers.html
look very promising

Regards
Wolfgang Hamann





pgsql-general by date:

Previous
From: George Neuner
Date:
Subject: Re: intermittent issue with windows 7 service manager not able to correctly determine or control postgresql 9.4
Next
From: hamann.w@t-online.de
Date:
Subject: Re: Skip trigger?