agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: gmb <gmbouwer@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Disable Trigger for session only
Date: Mon, 29 Jun 2015 00:43:18 -0700 (MST)
Message-ID: <1435563798887-5855658.post@n5.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
Hi
I' pretty sure I know the answer, but trying my luck.
I'm in a position where the most logical/effective way of doing an update
(data fix) is this:
ALTER TABLE temp DISABLE TRIGGER trigname;
UPDATE temp ..... DO SOME STUFF....
ALTER TABLE temp DISABLE TRIGGER trigname;
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.
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 ?
I'm aware that session_replication_role can be used as alternative to
disable triggers, and have been using it in other scenarios. But in this
case i'd like to choose which trigger to disable (I want other triggers on
table temp to still occur).
Is there any other alternatives to this ?
Will appreciate any input
--
View this message in context: http://postgresql.nabble.com/Disable-Trigger-for-session-only-tp5855658.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (8+ messages) latest in thread
Message-ID: <1435563798887-5855658.post@n5.nabble.com>
Permalink: ../1435563798887-5855658.post@n5.nabble.com/
Also on: postgresql.org/message-id/1435563798887-5855658.post@n5.nabble.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: gmbouwer@gmail.com
Subject: Re: Disable Trigger for session only
In-Reply-To: <1435563798887-5855658.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox