X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8D4CB329E46 for ; Wed, 22 Sep 2004 07:10:16 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 25048-02 for ; Wed, 22 Sep 2004 06:10:12 +0000 (GMT) Received: from natnoddy.rzone.de (natnoddy.rzone.de [81.169.145.166]) by svr1.postgresql.org (Postfix) with ESMTP id 00344329D9F for ; Wed, 22 Sep 2004 07:10:11 +0100 (BST) Received: from linux (pD9E68E52.dip.t-dialin.net [217.230.142.82]) by post.webmailer.de (8.12.10/8.12.10) with SMTP id i8M6A5Ga024848; Wed, 22 Sep 2004 08:10:05 +0200 (MEST) Date: Wed, 22 Sep 2004 08:10:05 +0200 From: Lutz Steinborn To: Theo Galanakis Cc: pgsql-admin@postgresql.org Subject: Re: Postgres SQL Monitor tool Message-Id: <20040922081005.5d7876fe.l.steinborn@4c-ag.de> In-Reply-To: <82E30406384FFB44AFD1012BAB230B55037D05CE@shiva.au.lpint.net> References: <82E30406384FFB44AFD1012BAB230B55037D05CE@shiva.au.lpint.net> Organization: 4c AG X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/199 X-Sequence-Number: 14902 Hi Theo, yes you can log every SQL statement. Just edit the postgresql.conf and delete the remark (#) from the following = line: #log_statement =3D false Then restart postgres. After this you can find every statement in the postgresql.log. On Gentoo yo= u 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 wrote: >=20 > 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 ru= n. >=20 > Theo >=20 --=20 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=FCnchen http://www.4c-shopping.de http://www.wohndesign.de http://www.wohnen.de