配置
log_destination = 'csvlog'
logging_collector = off
log_directory = 'pg_log'
log_connections = on
log_disconnections = on
log_line_prefix = '%t [%p-%l] %q%u@%d '
log_statement = 'none' 全体数据库全局变量

sql方式
alter role postgres set log_statement = 'none'; //postgres用户下所有数据库
alter role postgres in database my_db set log_statement='none';//postgres用户下某一个数据库

查看
select * from pg_db_role_setting ;
setdatabase | setrole | setconfig
-------------+---------+---------------------
27602 | 10 | {log_statement=none}
0 | 10 | {log_statement=none}
(2 rows)

setdatabase 0 为全部数据库

select a.*,b.datname,c.rolname from pg_db_role_setting a,pg_database b,pg_roles c where a.setdatabase=b.oid and a.setrole=c.oid;
setdatabase | setrole | setconfig | datname | rolname
-------------+---------+---------------------+----------+----------
27602 | 10 | {log_statement=ddl} | new_test | postgres
(1 row)

修改后重新启动数据库才能生效。reload不好使

05-11 20:17