Current Query from Trigger

From: Michael Fork <mfork00(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Current Query from Trigger
Date: 2004-06-19 02:47:21
Message-ID: 20040619024721.56502.qmail@web52401.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

All,

I am trying to create a basic auditing mechanism using
triggers and would like to create a table that
contains the following information:

audit_operation = TG_OP
audit_username = CURRENT_USER
audit_time = CURRENT_TIMESTAMP
audit_table = TG_RELNAME
audit_key = NEW.key_field (or OLD.key_field)
audit_statement = ??????

How can I get the SQL statement that triggered the
trigger?

Thanks.

Michael

Responses

  • Escape chars at 2004-06-19 03:55:28 from Luiz Rafael Culik Guimaraes

Browse pgsql-general by date

  From Date Subject
Next Message Ron Snyder 2004-06-19 02:48:13 Re: putting binary data in a char field?
Previous Message Scot L. Harris 2004-06-19 01:49:19 Re: RHEL 2.1 rpms for 7.4.2