Feature request from irc...

Started by Christopher Kings-Lynneover 20 years ago4 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

Is it possible for a pl/pgsql trigger function to look at the sql
command that caused it to be triggered? If not, is this an idea?

Chris

#2Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Christopher Kings-Lynne (#1)
Re: Feature request from irc...

Use case is making a trigger than can log queries on tables...

Christopher Kings-Lynne wrote:

Show quoted text

Is it possible for a pl/pgsql trigger function to look at the sql
command that caused it to be triggered? If not, is this an idea?

Chris

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#3Denis Lussier
denis@enterprisedb.com
In reply to: Christopher Kings-Lynne (#2)
Re: Feature request from irc...

I personally think it's an interesting idea. Is there a business scenario where you want/need to do this?? I think it'd be kinda cool for a trigger to be able to write out an audit record with the dml sql (along with the typical old, and new value stuff). Perhaps this is already doable??

________________________________

From: pgsql-hackers-owner@postgresql.org on behalf of Christopher Kings-Lynne
Sent: Tue 6/28/2005 11:54 PM
To: Hackers
Subject: [HACKERS] Feature request from irc...

Is it possible for a pl/pgsql trigger function to look at the sql
command that caused it to be triggered? If not, is this an idea?

Chris

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: Feature request from irc...

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:

Is it possible for a pl/pgsql trigger function to look at the sql
command that caused it to be triggered? If not, is this an idea?

What exactly is the use case for this? It cannot have anything to do
with assuming that you know what has happened or will happen, since
you cannot know how the original query behavior has been modified by
triggers that fired before you did or will fire after you.

regards, tom lane