Skip to main content
2 of 4
added 156 characters in body
Sathish
  • 113
  • 5

The following settings are made at the Database-Cluster Level. However, the same settings can be applied at the database , user, or session level. They will be different from what is explained below for database cluster level.

1. Check your current settings of log_statement parameter

postgres=# show log_statement;
-[ RECORD 1 ]-+-----
log_statement | all

2. Edit your postgresql.conf file, change the log_statement value to 'none'

vi data-dir/postgresql.conf

# what to log
# uncomment this line, if commented
log_statement = 'none'

:wq

2. Reload Postgres Server. Try either one of two methods given below:

a. Inside database using psql utility:

 psql -p 5432 dbname username
 SELECT pg_reload_conf();

b. On Bash or Shell Terminal

 pg_ctl -D path-to-database-cluster-directory reload

4. Verify your setting has been activated in the server

postgres=# \x
Expanded display is on.
postgres=# select * from pg_settings where name='log_statement';
-[ RECORD 1 ]-----------------------------------
name       | log_statement
setting    | none
unit       | 
category   | Reporting and Logging / What to Log
short_desc | Sets the type of statements logged.
extra_desc | 
context    | superuser
vartype    | enum
source     | default
min_val    | 
max_val    | 
enumvals   | {none,ddl,mod,all}
boot_val   | none
reset_val  | none
sourcefile | 
sourceline | 

postgres=# show log_statement;
-[ RECORD 1 ]-+-----
log_statement | none
Sathish
  • 113
  • 5