Question about PostgreSQL logging configuration

From: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Question about PostgreSQL logging configuration
Date: 2012-11-29 23:35:30
Message-ID: CAK-MWwR7tCJXSubo6umU=R0rdgSEQdzrYc09dha82_VzZvvUiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have some interesting question about PostgreSQL logging configuration.

I want log all 'mod' statements with their execution times and all
statements longer than 10ms (also with their execution times).

Now I have 3 setting to play with:
log_min_duration_statement
log_duration
log_statement

But it seems that I could not have configuration which doing what I looking for.

Because:
log_min_duration_statement=10ms
log_duration = off
log_statement = mod
will log almost everything what I need but db did not log execution
times for mod statements in that case.

Alternatively if I try:
log_min_duration_statement=10ms
log_duration = on
log_statement = mod
db will log execution times of every query (not only mod and ones
longer 10ms) thus producing lot noise and exceptionally large log
files.

I could not keep log_min_duration_statement=0 on database with 20000+
requests per second.

Is there any good solution for that task?

--
Maxim Boguk
Senior Postgresql DBA
http://www.postgresql-consulting.ru/

Phone RU: +7 910 405 4718
Phone AU: +61 45 218 5678

Skype: maxim.boguk
Jabber: maxim(dot)boguk(at)gmail(dot)com
МойКруг: http://mboguk.moikrug.ru/

"People problems are solved with people.
If people cannot solve the problem, try technology.
People will then wish they'd listened at the first stage."

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-11-30 01:58:01 Re: youtube video on pgsql integrity
Previous Message Gavan Schneider 2012-11-29 23:19:30 Re: youtube video on pgsql integrity