Skip site navigation (1) Skip section navigation (2)

Re: Enable/Disable Trigger per single transaction

From: "Duncan Garland" <duncan(dot)garland(at)ntlworld(dot)com>
To: "Derrick Betts" <list(at)blueaxis(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Enable/Disable Trigger per single transaction
Date: 2007-01-27 17:15:45
Message-ID: MBEPKEEDMKGCDODFKLPPIEOPDLAA.duncan.garland@ntlworld.com (view raw or flat)
Thread:
Lists: pgsql-novice
I don't know if there's a clever way to do it, but the user can be
identified via the pseudo-column user.

e.g.

SELECT DISTINCT user FROM team;
 current_user
--------------
 dev
(1 row)

( user is not a column in team. )

You could incorporate that into the trigger logic.

Regards

Duncan
-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Derrick Betts
Sent: 27 January 2007 16:49
To: pgsql-novice(at)postgresql(dot)org
Subject: [NOVICE] Enable/Disable Trigger per single transaction


Assuming we have well over 1000 users accessing the database through a web
application.
We have a row-level trigger set up on table "alpha" that gets executed after
updates.

I was wondering if there is a way to temporarily disable a trigger on table
"alpha" for a single user, even though there may be 999 other users sending
transactions to the database that need the trigger to remain in place?  For
example, I only want the trigger disabled for one single transaction (using
commands inside that transaction) while the trigger still gets fired
properly for the other 999 transactions that hit the database
simultaneously.

Is this possible at present?

Thank you for your insights,
Derrick



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


In response to

pgsql-novice by date

Next:From: Frank BaxDate: 2007-01-29 02:30:46
Subject: 8.2.1 to_char(negative interval,'HH24:MI') bug?
Previous:From: Derrick BettsDate: 2007-01-27 16:48:37
Subject: Enable/Disable Trigger per single transaction

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group