Re: Getting

From: Dan Ng <surfnet(at)yahoo(dot)com>
To: Greg Williamson <gwilliamson39(at)yahoo(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Getting
Date: 2013-01-24 16:57:04
Message-ID: 1359046624.26078.YahooMailNeo@web120904.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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 <gwilliamson39(at)yahoo(dot)com>
To:
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Sent: Thursday, January 24, 2013 1:08 AM
Subject: Re: [ADMIN] Getting

Dan --

>________________________________
> From: Michael Holt <MHolt(at)terapeak(dot)com>
>To: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>; Dan Ng <surfnet(at)yahoo(dot)com>
>Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
>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

In response to

  • Re: Getting at 2013-01-24 09:08:17 from Greg Williamson

Browse pgsql-admin by date

  From Date Subject
Next Message Viktor 2013-01-25 15:01:16 Archiving
Previous Message Greg Williamson 2013-01-24 09:08:17 Re: Getting