Re: Question about PostgreSQL logging configuration

From: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about PostgreSQL logging configuration
Date: 2012-11-30 04:17:49
Message-ID: CAK-MWwSDzQ4eDEPpbwqkBsr7ms+wZ355-0kdmVe7FzZQzrYLpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> I want log all 'mod' statements with their execution times and all
>> statements longer than 10ms (also with their execution times).
>
> You cannot combine things as you want. However, it seems a fairly
> minor loss - why would you care about how fast sub-10ms mods
> ran?

Trouble if I try that way, than database log for mod statements over
10ms duration will be written in wrong style:
2012-11-30 08:06:28 MSK [vxid:229/5138506 txid:1345713884] [INSERT]
LOG: duration: 10.158 ms
2012-11-30 08:06:28 MSK [vxid:325/5420118 txid:0] [UPDATE] LOG:
execute S_5: update applicant_adv_subscription ...

instead of more usual way:
2012-11-30 08:08:21 MSK [vxid:307/5334684 txid:0] [SELECT] LOG:
duration: 16.085 ms execute S_42: select ...

So at end I getting logs which are incompatible with pgFouine (and
with my custom log analyzer as well).

Is there any serious reason why log_duration = on uses so strange output style?

I could not think any reasonable case for use log_duration = on
without log_statements = all.

And log_duration = on with log_statements = all produce results which
are equivalent to log_min_duration_statement=0,
but log_min_duration_statement=0 produce logs which are much more easy
to parse and read in general.

Is there anyone who consciously used log_duration = on without
log_statements = all ?
And if yes - what for?

I might be very wrong, but log_duration seems close to useless knob in reality.

Kind Regards,
Maksym

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Sabino Mullane 2012-11-30 04:27:53 Re: Question about PostgreSQL logging configuration
Previous Message Greg Sabino Mullane 2012-11-30 03:54:46 Re: Question about PostgreSQL logging configuration