2017-01-10 4 views
1

Итак, я понимаю, что ВСЕ получат мне SELECTS, что я хотел бы отслеживать для своего приложения, однако демон POSTGRES запускает свой собственный вариант для базы данных и регистрирует его ...Logging = ALL issue on PostgresSQL 9.5 on Ubuntu 16.04

кто-нибудь знает, как избежать этого, как мой журнал будет заполняться довольно быстро

LOG: statement: SELECT 
      (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Transactions", 
      (SELECT sum(xact_commit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Commits", 
      (SELECT sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Rollbacks" 
2017-01-09 23:53:36 UTC [14264-16] [email protected] LOG: statement: SELECT 
      (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Transactions", 
      (SELECT sum(xact_commit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Commits", 
      (SELECT sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Rollbacks" 
2017-01-09 23:53:37 UTC [14264-17] [email protected] LOG: statement: SELECT 
      (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Transactions", 
      (SELECT sum(xact_commit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Commits", 
      (SELECT sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Rollbacks" 
2017-01-09 23:53:38 UTC [14264-18] [email protected] LOG: statement: SELECT 
      (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Transactions", 
      (SELECT sum(xact_commit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Commits", 
      (SELECT sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Rollbacks" 
2017-01-09 23:53:39 UTC [14264-19] [email protected] LOG: statement: SELECT 
      (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 16384)) AS "Transactions", .... 
... 
... 

ответ

1

только включить ведение журнала для приложения,

SQL:

ALTER USERyour_app_usernameSET log_statement='ALL';

+0

Ну, что кажется почти слишком легко, поэтому, наверное, я не нашел ничего в межсети ... Большое спасибо – CBERBER

+0

вы должны принять этот ответ, как правильно http://stackoverflow.com/помощь/кто-ответы – e4c5