Current Query from Trigger
Started by Michael Forkalmost 22 years ago3 messagesgeneral
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
Escape chars
Dear Friends
Does postgresql api has some function similar to mysql_real_escape_string()
?
Regards
Luiz