Re: How to trace client sql requests?

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: How to trace client sql requests?
Дата
Msg-id 20090710185835.GC9074@depesz.com
обсуждение исходный текст
Ответ на How to trace client sql requests?  ("James B. Byrne" <byrnejb@harte-lyne.ca>)
Ответы Re: How to trace client sql requests?
Список 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 по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Overhead of union versus union all
Следующее
От: Dan Armbrust
Дата:
Сообщение: Re: Checkpoint Tuning Question