pg_log_userqueries is a PostgreSQL module that logs each query executed by a
superuser. It records each query in the standard log file.
There are also two more optional parameters that allow you to log all queries
per database and/or per user.
* pg_log_userqueries.log_db: to give a pipe separated list of database to log.
* pg_log_userqueries.log_user: to give a pipe separated list of user to log.
You can use advanced regular expression in that list. For example:
will match if the exact username is 'postgres' or it begins by 'admin_' or ending by '_adm'.
By default pg_log_userqueries will write queries to PostgreSQL log destination. As superuser
can modify this behavior, you can force pg_log_userqueries to log independently into syslog
by setting a syslog facility.
This will enable syslog output by selecting a level of log. It takes the same options than
PostgreSQL syslog_facility configuration directive.
You can also modify the syslog program ident string with configuration directive:
Select syslog program identity name.