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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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