pg-audit-json icon indicating copy to clipboard operation
pg-audit-json copied to clipboard

`application_name` is not being saved in the audit.log table

Open paulovieira opened this issue 2 years ago • 0 comments

I noticed that application_name is not being saved. Turns out the call to current_setting has a wrong setting_name parameter: instead of

current_setting('audit.application_name', true)

it should be simply

current_setting('application_name', true)

https://github.com/m-martinez/pg-audit-json/blob/master/sql/pg-audit-json--1.0.2.sql#L223-L224

More details about application_name: https://www.postgresql.org/docs/current/runtime-config-logging.html#GUC-APPLICATION-NAME

By the way, the other setting the is supposed to be saved (application_user_name) doesn't seem to be valid.

Thanks for this nice tool!

paulovieira avatar Jul 01 '22 19:07 paulovieira