Re: fix log_min_duration_statement logic error - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: fix log_min_duration_statement logic error
Date
Msg-id 200310050249.h952nOM22210@candle.pha.pa.us
Whole thread Raw
In response to Re: fix log_min_duration_statement logic error  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: fix log_min_duration_statement logic error  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: fix log_min_duration_statement logic error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> I would prefer to see the log entries look like
> >>
> >> LOG: query: select * from pg_class;
> >> LOG: duration: nn.nnn msec
>
> > The problem with two lines is that another log message could get between
> > them.
>
> That was true already with log_statement and log_duration as separate
> operations.  People use log_pid to deal with it.

Attached are some emails I sent while we were discussing this feature in
March.

The idea was for the parameter to show query and duration --- a
combination that is asked for frequently and easily grep'ed, unlike
joining on pid, which because of pid wrap-around, isn't even fool-proof.

One thing that isn't implemented in current CVS is to allow 0 to always
print the duration and query (-1 disables it and is the default).  I can
see that being _very_ valuable, and used enough to warrant the fact that
it isn't orthoginal (we already have log_statement).  The reason we
needed to do it this way was so we could print the statement _after_ it
completes so we could include the duration.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: more spanish updates
Next
From: Bruce Momjian
Date:
Subject: Re: fix log_min_duration_statement logic error