Hi, The problem is the current_query (in pg_stat_activity) contains bind variables and I can't just take it to do the explain (and, of course I don't know the values of the bind variables). On a related issue, how can I see the actual sql statement when the current_query shows "<unnamed portal x>". pg_cursors is only accessible within the same transaction and as a DBA we want to see that cursor of any active transactions. Thanks, -Dan
________________________________ From: Greg Williamson <[email protected]> To: Cc: "[email protected]" <[email protected]> Sent: Thursday, January 24, 2013 1:08 AM Subject: Re: [ADMIN] Getting Dan -- >________________________________ > From: Michael Holt <[email protected]> >To: Raghavendra <[email protected]>; Dan Ng <[email protected]> >Cc: "[email protected]" <[email protected]> >Sent: Wednesday, January 23, 2013 9:55 PM >Subject: Re: [ADMIN] Getting > > > >Of course you can also see what the query plan will be without having to run >the query through a standard explain query: > > >http://www.postgresql.org/docs/9.0/static/sql-explain.html > > I am not familiar with the Oracle tools, but you should note that the "EXPLAIN ANALYZE" does actually do the transaction, so if you doing an update / insert / delete you may want to wrap it in an explicit transaction and then roll it back. HTH, Greg Williamson -- Sent via pgsql-admin mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin
