Re: Enable/Disable Trigger per single transaction - Mailing list pgsql-novice

From Duncan Garland
Subject Re: Enable/Disable Trigger per single transaction
Date
Msg-id MBEPKEEDMKGCDODFKLPPIEOPDLAA.duncan.garland@ntlworld.com
Whole thread Raw
In response to Enable/Disable Trigger per single transaction  ("Derrick Betts" <list@blueaxis.com>)
List 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@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Derrick Betts
Sent: 27 January 2007 16:49
To: pgsql-novice@postgresql.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


pgsql-novice by date:

Previous
From: "Derrick Betts"
Date:
Subject: Enable/Disable Trigger per single transaction
Next
From: Frank Bax
Date:
Subject: 8.2.1 to_char(negative interval,'HH24:MI') bug?