Reputation: 2935
I'm attempting to put together what I thought would be a simple audit ability in Postgres.
I intend to log session_id/user_id etc., but what I'm really after is logging the actual statement, in full. I know I can get the operation with TG_OP
, but does anybody know the secret sauce to get the actual text of the current statement?
Upvotes: 2
Views: 60
Reputation: 1781
This information can be retrieved with the current_query()
function.
Upvotes: 4