pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Atul Kumar <akumar14871@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: log_statement vs log_min_duration_statement
Date: Wed, 27 Sep 2023 10:12:45 +0200
Message-ID: <605173d4ea36cbd20d96c8f4695d00a558b4a543.camel@cybertec.at> (raw)
In-Reply-To: <CA+ONtZ7dOdN4hdqcgrNeVAe1U2BDGyYDA53aG2FydbM5s1qJ1g@mail.gmail.com>
References: <CA+ONtZ7dOdN4hdqcgrNeVAe1U2BDGyYDA53aG2FydbM5s1qJ1g@mail.gmail.com>

On Wed, 2023-09-27 at 00:01 +0530, Atul Kumar wrote:
> my postgres version is 12 and running on centos 7
> 
> my log_statement is set to "DDL".
> 
> and log_min_duration_statement is set to "1ms"
> 
> so technically it should log "ONLY DDLs" that take more than 1ms.
> 
> but to my surprise, postgres is logging DML as well which is taking more than 1ms.

log_statement = 'ddl'  will log all DDL.

log_min_duration_statement = 1  will log all statements that take longer
than a millisecond.

These settings are independent from each other.  So PostgreSQL logs
all statements that are DDL *OR* that take longer than a millisecond,
rather than all statements that are DDL *AND* take longer than a
millisecond, as you seem to expect.

Yours,
Laurenz Albe





view thread (5+ messages)

Message-ID: <605173d4ea36cbd20d96c8f4695d00a558b4a543.camel@cybertec.at>
Permalink:  ../605173d4ea36cbd20d96c8f4695d00a558b4a543.camel@cybertec.at/
Also on:    postgresql.org/message-id/605173d4ea36cbd20d96c8f4695d00a558b4a543.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, akumar14871@gmail.com
  Subject: Re: log_statement vs log_min_duration_statement
  In-Reply-To: <605173d4ea36cbd20d96c8f4695d00a558b4a543.camel@cybertec.at>
  References: <CA+ONtZ7dOdN4hdqcgrNeVAe1U2BDGyYDA53aG2FydbM5s1qJ1g@mail.gmail.com> <605173d4ea36cbd20d96c8f4695d00a558b4a543.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox