Re: duplicate key errors in log file

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: anj patnaik <patna73(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: duplicate key errors in log file
Date: 2015-11-18 17:34:26
Message-ID: 564CB6A2.3000707@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/17/2015 03:33 PM, anj patnaik wrote:
> The pg log files apparently log error lines every time a user inserts a
> duplicate. I implemented a composite primary key and then when I see the
> exception in my client app I update the row with the recent data.
>
> however, I don't want the log file to fill out with these error messages
> since it's handled by the client.
>
> is there a way to stop logging certain messages?

http://www.postgresql.org/docs/9.4/interactive/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT

log_min_error_statement (enum)

Controls which SQL statements that cause an error condition are
recorded in the server log. The current SQL statement is included in the
log entry for any message of the specified severity or higher. Valid
values are DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, INFO, NOTICE,
WARNING, ERROR, LOG, FATAL, and PANIC. The default is ERROR, which means
statements causing errors, log messages, fatal errors, or panics will be
logged. To effectively turn off logging of failing statements, set this
parameter to PANIC. Only superusers can change this setting.

>
> Also do any of you use any options to cause log files not to fill up the
> disk over time?
>
> Thanks,
> ap

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2015-11-18 17:35:15 Re: Taking lot time
Previous Message Jim Nasby 2015-11-18 17:32:58 Re: drop index without accessexclusivelock in transaction (JAVA)