Re: Monitoring Postgres - Get the SQL queries which are sent to postgres - Mailing list pgsql-general

From Vivek Khera
Subject Re: Monitoring Postgres - Get the SQL queries which are sent to postgres
Date
Msg-id 90B34999-558F-4938-9278-2377338B266F@khera.org
Whole thread Raw
In response to Re: Monitoring Postgres - Get the SQL queries which are sent to postgres  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List pgsql-general
On Oct 25, 2006, at 10:11 AM, A. Kretschmer wrote:

> Set this in your postgresql.conf:
>
> log_statement = all
>
> Reload the server, and then you can find all your statements in the
> log.

or, preferably, on a per-connection basis, execute this SQL statement:

set log_min_duration_statement = 0

then only those queries for that connection will be logged.
otherwise you get *way* too much stuff to sort out.

Another useful setting which I always enable (in my postgresql.conf
file) is

log_min_error_statement = error

so that any statement that generates an error will be appended to the
error log entry.  otherwise you just see the error notice and have no
clue what caused it.


Attachment

pgsql-general by date:

Previous
From: Volkan YAZICI
Date:
Subject: Re: more than 32 parameters to a function?
Next
From: David Fetter
Date:
Subject: Re: more than 32 parameters to a function?