Re: Disable Trigger for session only - Mailing list pgsql-sql

From gmb
Subject Re: Disable Trigger for session only
Date
Msg-id 1435587185136-5855697.post@n5.nabble.com
Whole thread Raw
In response to Re: Disable Trigger for session only  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Disable Trigger for session only  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-sql
Adrian Klaver-4 wrote
>>
>> Some notes:
>> It cannot be guaranteed that the above happens as a single transaction.
>> It is possible that this occurs at the same time as other session posting
>> inserts/updates to table TEMP.
> 
> It can if wrapped in BEGIN/COMMIT or is there reason that is not being
> done?

Sorry , what I meant to say was that as this stage this is not implemented
in a single transaction (with BEGIN/COMMIT).


Adrian Klaver-4 wrote
>> I'm seeing data which suggests that trigger trigname did not occur when
>> in
>> fact it should have ( i.e. the above update procedure is not relevant ).
>> Does this make sense taking into account that multiple sessions posts to
>> the
>> table at once ?
> 
> Not without knowing what the trigger procedure does?

The trigger being disabled is used to post summarized numeric values to a
summary table.
Actually what I'm trying to do here is to reset the values in the detail
table to zero without updating the summary tables. Afterwards I'm updating
from a zero value which means that the difference will be posted to the
summary table. This kind of data fix is required where data on the summary
tables was not posted as excepted for whatever reason. 


I guess my question is:
If I encapsulate the "disable trigger/update/enable trigger" in BEGIN/COMMIT
to handle as single transaction, are there guarantees that the disabling of
the trigger will not have an effect on other sessions ?



--
View this message in context: http://postgresql.nabble.com/Disable-Trigger-for-session-only-tp5855658p5855697.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



pgsql-sql by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Disable Trigger for session only
Next
From: Adrian Klaver
Date:
Subject: Re: Disable Trigger for session only