Re: display previous query string of idle-in-transaction - Mailing list pgsql-hackers

From Tatsuhito Kasahara
Subject Re: display previous query string of idle-in-transaction
Date
Msg-id 49CB6039.9060306@oss.ntt.co.jp
Whole thread Raw
In response to Re: display previous query string of idle-in-transaction  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
List 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
stringand 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.tatsuhito@oss.ntt.co.jp


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: New trigger option of pg_standby
Next
From: Robert Treat
Date:
Subject: Re: small but useful patches for text search