Skip site navigation (1) Skip section navigation (2)

Re: Postgres SQL Monitor tool

From: Lutz Steinborn <l(dot)steinborn(at)4c-ag(dot)de>
To: Theo Galanakis <Theo(dot)Galanakis(at)lonelyplanet(dot)com(dot)au>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Postgres SQL Monitor tool
Date: 2004-09-22 06:10:05
Message-ID: 20040922081005.5d7876fe.l.steinborn@4c-ag.de (view raw or flat)
Thread:
Lists: pgsql-admin
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(dot)Galanakis(at)lonelyplanet(dot)com(dot)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(dot)steinborn(at)4c-ag(dot)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

In response to

pgsql-admin by date

Next:From: Bradley KieserDate: 2004-09-22 13:21:42
Subject: Getting the OID of inserted row in a rule
Previous:From: Theo GalanakisDate: 2004-09-22 05:51:35
Subject: Postgres SQL Monitor tool

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group