Re: How to trace client sql requests? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: How to trace client sql requests?
Date
Msg-id 20090710185835.GC9074@depesz.com
Whole thread Raw
In response to How to trace client sql requests?  ("James B. Byrne" <byrnejb@harte-lyne.ca>)
Responses Re: How to trace client sql requests?
List pgsql-general
On Fri, Jul 10, 2009 at 01:38:57PM -0400, James B. Byrne wrote:
> I have a situation with a Rails project where test data in
> mysteriously "disappearing" in the middle of a test run.  I would
> like to see the exact SQL of all client requests issued against a
> single table during a fixed time span.
> How can I best accomplish this in PostgreSQL?
> #client_min_messages = notice
> #log_min_messages = notice
> #log_min_duration_statement = -1
> ...
> #log_duration = off
>
> Which of these, if any, should I alter; and to what?  Am I

I prefer to set log_min_duration_statement to 0. It will log all queries
and their running time.

> constrained to system wide logging or can this be enabled by
> database?

You can enable by database:

alter database x set log_min_duration_statement = 0;

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Overhead of union versus union all
Next
From: Dan Armbrust
Date:
Subject: Re: Checkpoint Tuning Question