pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lutz Steinborn <l.steinborn@4c-ag.de>
To: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
Cc: pgsql-admin@postgresql.org
Subject: Re: Postgres SQL Monitor tool
Date: Wed, 22 Sep 2004 08:10:05 +0200
Message-ID: <20040922081005.5d7876fe.l.steinborn@4c-ag.de> (raw)
In-Reply-To: <82E30406384FFB44AFD1012BAB230B55037D05CE@shiva.au.lpint.net>
References: <82E30406384FFB44AFD1012BAB230B55037D05CE@shiva.au.lpint.net>

Hi Theo,

yes you can log every SQL statement.
Just edit the postgresql.conf and delete the remark (#) from the following line:
#log_statement = false

Then restart postgres.

After this you can find every statement in the postgresql.log. On Gentoo you can
find this log in /var/lib/postgresql/data.

But keep in mind that logging every statement takes a lot of time.

Best regards
Lutz


On Wed, 22 Sep 2004 15:51:35 +1000
Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au> wrote:

> 
> Is there a log file, or a method of logging all the SQL statements a
> postgres server processes. I can look at pg_stat_activity which tells me
> each postgres process and the current query running, however I wanted to see
> a log file, similar to SQL Servers Profiler, where I can capture all the SQL
> being run. I guess I could write some external process to poll the
> pg_stat_activity and collect current processors and SQL commands being run.
> 
> Theo
> 


-- 
Lutz Steinborn                   mailto:l.steinborn@4c-ag.de
4c AG                            Tel +49 6092 999592
Stefan-George-Ring 22-24         Fax +49 89 99341 399
81929 München                    http://www.4c-shopping.de
                                 http://www.wohndesign.de
                                 http://www.wohnen.de



view thread (2+ messages)

Message-ID: <20040922081005.5d7876fe.l.steinborn@4c-ag.de>
Permalink:  ../20040922081005.5d7876fe.l.steinborn@4c-ag.de/
Also on:    postgresql.org/message-id/20040922081005.5d7876fe.l.steinborn@4c-ag.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: l.steinborn@4c-ag.de, Theo.Galanakis@lonelyplanet.com.au
  Subject: Re: Postgres SQL Monitor tool
  In-Reply-To: <20040922081005.5d7876fe.l.steinborn@4c-ag.de>
  References: <82E30406384FFB44AFD1012BAB230B55037D05CE@shiva.au.lpint.net> <20040922081005.5d7876fe.l.steinborn@4c-ag.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox