Re: display previous query string of idle-in-transaction

From: Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>, depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: display previous query string of idle-in-transaction
Date: 2009-03-26 11:00:09
Message-ID: 49CB6039.9060306@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ITAGAKI Takahiro wrote:
> The feature could be achieved by an extension module using new executor
> hooks in 8.4. It is just like contrib/pg_stat_statements;
Well, it is a good idea.

Displaying last-query-string may be useful, but it is not a feature for
general purpose. So, it may be an external module.

Now, I have two choice.

1. Displaying last-query-string by pg_stat_activity (suggested by Gurjeet):
Extends the pg_stat_activity to display "previous_query".
We can check only a previous query.

2. Displaying query-string-history by external module (suggested by Itagaki):
Using executor hook to get a query string and stores it in
shared memory.
We can check specified number of query string history.

I think I will try mainly 2.
# Or this feature may merge to pg_stat_statements.
Any comments welcome.

Best regards,
--
Tatsuhito Kasahara
kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2009-03-26 11:33:38 Re: small but useful patches for text search
Previous Message Simon Riggs 2009-03-26 10:50:33 Re: New trigger option of pg_standby