Re: log_duration / log_min_duration_statement differences between 8.1.8 and 8.2.4

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: scottb(at)intercastingcorp(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: log_duration / log_min_duration_statement differences between 8.1.8 and 8.2.4
Date: 2007-09-29 10:59:01
Message-ID: 200709291059.l8TAx1h13647@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

scottb(at)intercastingcorp(dot)com wrote:
> Hi,
>
> We're starting to migrate from postgres 8.1.8 to 8.2.4
> and noticing behavioral differences in what they log (via syslog to /var/log/pgsql)
>
> The behavior we have on 8.1.8 is:
> * log all data-modification queries (with duration)
> * log all queries that take longer than 1000 millisec (with duration)
>
>
> We'd like to have that behavior on 8.2.x as well.
>
> Instead we're getting:
> * log all data-modification queries (with duration)
> * log all queries that take longer than 1000 millisec (with duration)
> PLUS
> * (unwanted) log durations only for fast, non-mod queries
> example:
> Sep 26 09:03:50 db02 postgres[3882]: [78-1] db=our_db; user=app_writer; host=a.b.c.d; LOG: duration: 0.030 ms
>
> When I set
> log_duration = off
> I avoid the unwanted durations of fast SELECTs, but also lose the durations of the data-modification queries.
>
> * log all data-modification queries ( WITHOUT duration)
> * log all queries that take longer than 1000 millisec (with duration)
>
>
> Any suggestions ?

Uh, not sure. It is this change in 8.2 that is causing the issue:

* Change log_duration to output even if the query is not output (Tom)

In prior releases, log_duration only printed if the query
appeared earlier in the log.

We had a pretty long discussion about it:

http://archives.postgresql.org/pgsql-hackers/2006-09/msg00681.php

My guess is that you were using that the behavior about the querying
having to appear earlier in the log. I don't think we have a solution
for this anymore, but the API is cleaner. ;-)

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Kempter 2007-10-01 16:22:24 last access times?
Previous Message michal.zaborowski 2007-09-28 11:37:07 Re: wholly / partially table read into shared buffer