The PostgreSQL documentation lists a number of System Information Functions which provide state from the current connection, such as
pg_backend_pid(). I would like to create an audit trail for updates to a table which includes the
application_name, but there does not seem to be a function for accessing this.
application_name is visible from the
pg_stat_activity view and is set by clients in the format of
How can this information be accessed from a trigger?