Re: Long binded parameter value in the postgres log

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Nikitin Nikolay <Nikolay(dot)Nikitin(at)infowatch(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Long binded parameter value in the postgres log
Date: 2017-06-08 16:31:55
Message-ID: CAD21AoA0HQ5JKmHxxz6N7iSfpo-WUdSY7DRPSV7pnSTjCs6tEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 8, 2017 at 5:00 PM, Nikitin Nikolay
<Nikolay(dot)Nikitin(at)infowatch(dot)com> wrote:
> Hi!
>
>
>
> We insert many rows with long text and bytea (about 500 MB) values. In the
> postgres config we set log_min_duration_statement to 120 seconds.
>
> If this statements work more 120 seconds then they will be written into the
> postgres log with parameter values.
>
> As a result, the postgres log increases by 500MB for each statement.
>
>
>
> I think the postgres should have a "max bind value log size" parameter. If a
> bind value is bigger then this parameter, it will be truncated.
>
> And in the log its real size and its truncated part will be written.
>

In this case, I think you can use log_error_verbosity = terse which
excludes the logging of DETAIL, HINT, QUERY, and CONTEXT error
information. On the other hand, since actually the log of particular
large SQL or its parameter sometimes presses the free capacity,
possibly it's a good idea to have such threshold.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-06-08 16:49:37 Re: Adding support for Default partition in partitioning
Previous Message Regina Obe 2017-06-08 15:57:49 Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity