From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-admin@postgresql.org
Subject: Re: Finding current SQL activity
Date: Wed, 18 Oct 2006 12:06:32 +0300
Message-ID: <200610181206.33958.achill@matrix.gatewaynet.com> (raw)
In-Reply-To: <20061018080606.90849.qmail@web56608.mail.re3.yahoo.com>
References: <20061018080606.90849.qmail@web56608.mail.re3.yahoo.com>
Óôéò ÔåôÜñôç 18 Ïêôþâñéïò 2006 11:06, ï/ç Thusitha Kodikara Ýãñáøå:
> Hi,
>
> I would like to find the current (and very recent) SQL statements. I went
> through 'pg_stat_activity'. But it showed only the current statement I was
> issuing. Going through the defintion of 'pg_stat_activity' I came across
> pg_stat_get_backend_activity(), and I thought if I could get the source of
> this function I would be able to further. But I can't see the definition of
> this function.
>
pg_stat_get_backend_activity() is an internal function, so in order to see how
it works you must look .../src/backend/utils/adt/pgstatfuncs.c
> Am I on the right direction, or is there an easier way? I would appreciate
> if someone can give some suggestions.
>
However, the system can give only active queries, if you need recent queries
then you should enable
log_statement = true
in postgresql.conf and
kill -HUP <postmaster_pid>
where postmaster_pid is
tail -1 ~postgres/data/postmaster.pid
> Thanks in advance.
>
> -Thusitha
--
Achilleas Mantzios
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: achill@matrix.gatewaynet.com
Subject: Re: Finding current SQL activity
In-Reply-To: <200610181206.33958.achill@matrix.gatewaynet.com>
References: <20061018080606.90849.qmail@web56608.mail.re3.yahoo.com> <200610181206.33958.achill@matrix.gatewaynet.com>
* 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