debian - Logging PostgreSQL interactive queries -


i have several people doing database queries directly systems.

i log secure syslog server queries done interactively/by hand, or failing that, queries done using psql binary client.

i using debian jessie, postgresql 9.4 , 9.1.

how achieve that?

there a multitude of methods setting configuration variables, varying scopes.

as log_statement superuser-only setting, can rule out of client-side options, , server- or database-wide settings presumably broad case.

i believe leaves per-user option, i.e.:

alter user interactive_user set log_statement = 'all'; 

or if makes things easier manage:

alter system set log_statement = 'all'; alter user application_user set log_statement = 'none'; 

note these settings applied on connection, cannot triggered (or bypassed) via set role commands.

of course, assumes application , interactive users aren't sharing logins, don't think there's else right level of granularity.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -