pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres SQL Monitor tool
2+ messages / 2 participants
[nested] [flat]
* Postgres SQL Monitor tool
@ 2004-09-22 05:51 Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
0 siblings, 1 reply; 2+ messages in thread
From: Theo Galanakis @ 2004-09-22 05:51 UTC (permalink / raw)
To: pgsql-admin
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
______________________________________________________________________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Postgres SQL Monitor tool
@ 2004-09-22 06:10 Lutz Steinborn <l.steinborn@4c-ag.de>
parent: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
0 siblings, 0 replies; 2+ messages in thread
From: Lutz Steinborn @ 2004-09-22 06:10 UTC (permalink / raw)
To: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>; +Cc: 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.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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-09-22 06:10 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-09-22 05:51 Postgres SQL Monitor tool Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
2004-09-22 06:10 ` Lutz Steinborn <l.steinborn@4c-ag.de>
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