pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Query duration and query text
3+ messages / 2 participants
[nested] [flat]

* Query duration and query text
@ 2020-11-30 17:15  Yambu <hyambu@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Yambu @ 2020-11-30 17:15 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hello

May i know why the query and the duration are recorded as separate lines in
postgres csv logs?

Is there a way I can make the query and the duration to be in the same line?

regards

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Query duration and query text
@ 2020-11-30 17:28  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Yambu <hyambu@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2020-11-30 17:28 UTC (permalink / raw)
  To: Yambu <hyambu@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Yambu <hyambu@gmail.com> writes:
> May i know why the query and the duration are recorded as separate lines in
> postgres csv logs?

log_statement and log_duration are independent features.

> Is there a way I can make the query and the duration to be in the same line?

If you drop those and instead set log_min_duration_statement = 0 (or
some positive value) then the statement will be printed with the duration.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Query duration and query text
@ 2020-11-30 21:38  Yambu <hyambu@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Yambu @ 2020-11-30 21:38 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Thanks it works
On 30 Nov 2020 7:28 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

> Yambu <hyambu@gmail.com> writes:
> > May i know why the query and the duration are recorded as separate lines
> in
> > postgres csv logs?
>
> log_statement and log_duration are independent features.
>
> > Is there a way I can make the query and the duration to be in the same
> line?
>
> If you drop those and instead set log_min_duration_statement = 0 (or
> some positive value) then the statement will be printed with the duration.
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-11-30 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 17:15 Query duration and query text Yambu <hyambu@gmail.com>
2020-11-30 17:28 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-11-30 21:38   ` Yambu <hyambu@gmail.com>

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