Can't change or turn off postgres logging
database, postgresql, relational-database, sql
Solution
Looking at your example, it looks like you are seeing the return message of the insert statement displayed. This is not a logging message but just provides information (OID if any, number of rows affected) of the inserted row.
You are right, that `INSERT 0 1` message can't be disabled on the server side. It is psql displaying status info given back by PostgreSQL as a routine part of the protocol. You can disable it by redirecting STDERR from psql to /dev/null but that is about the only way.
Problem
I'm trying to set the logging level in postgres to "error" or turn it off altogether. Relevant parts of postgresql.conf: ``` log_min_error_statement = error log_statement = 'none' log_min_duration_statement = -1 ``` I tried these settings on newly created users and databases to no avail. I restarted postgres server repeatedly. I also tried these commands in psql: ``` alter database mydb reset log_statement; alter database mydb set log statement = 'none'; alter user myuser reset log_statement; alter user myuser set log_statement = 'none'; alter database mydb reset log_min_duration_statement; alter database mydb set log log_min_duration_statement = -1; alter user myuser reset log_min_duration_statement; alter user myuser set log_min_duration_statement = -1; ``` Some relevant commands and their outputs: ``` postgres=# select pg_reload_conf(); pg_reload_conf ---------------- t (1 row) postgres=# show log_min_duration_statement; log_min_duration_statement ---------------------------- -1 (1 row) postgres=# show log_statement; log_statement --------------- none (1 row) ``` There are no applications connected to the database. Just to make sure: ``` postgres=# select pg_terminate_backend(pid) from pg_stat_activity where datname='mydb'; pg_terminate_backend ---------------------- (0 rows) ``` edit: I wasn't aware that client messages and logs are not the same thing. Settings above get the job done for setting log_min_error_statement to "ERROR". Changing client_min_messages doesn't work: ``` image_search=> show client_min_messages; client_min_messages --------------------- notice (1 row) image_search=> set client_min_messages to 'ERROR'; SET image_search=> show client_min_messages; client_min_messages --------------------- error (1 row) image_search=> insert into ones_counts(key, ones) values (5,5); INSERT 0 1 ``` That solution https://stackoverflow.com/a/11411109/1508077 does not work either. I inadvertently duplicated the question. It should really be about suppressing INFO messages when running psql scripts. Not about logging. I'm on OS X Mavericks. Postgres 9.3.0 installed via homebrew.