pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Ng <surfnet@yahoo.com>
To: Greg Williamson <gwilliamson39@yahoo.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Getting
Date: Thu, 24 Jan 2013 08:57:04 -0800 (PST)
Message-ID: <1359046624.26078.YahooMailNeo@web120904.mail.ne1.yahoo.com> (raw)
In-Reply-To: <1359018497.35010.YahooMailNeo@web125906.mail.ne1.yahoo.com>
References: <1358965207.49445.YahooMailNeo@web120905.mail.ne1.yahoo.com>
	<CA+h6Ahg6eDD=eVb5CrfeGCAevkRUSqcqWoC+7H_z8FO_RO=dCg@mail.gmail.com>
	<E7907DC29186A94988A077445AFD1DC02514D9AA@EXCHANGEVIC.ad.terapeak.com>
	<1359018497.35010.YahooMailNeo@web125906.mail.ne1.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@yahoo.com>
To: 
Cc: "pgsql-admin@postgresql.org" <pgsql-admin@postgresql.org> 
Sent: Thursday, January 24, 2013 1:08 AM
Subject: Re: [ADMIN] Getting

Dan --

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



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

view thread (5+ messages)

Message-ID: <1359046624.26078.YahooMailNeo@web120904.mail.ne1.yahoo.com>
Permalink:  ../1359046624.26078.YahooMailNeo@web120904.mail.ne1.yahoo.com/
Also on:    postgresql.org/message-id/1359046624.26078.YahooMailNeo@web120904.mail.ne1.yahoo.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: surfnet@yahoo.com, gwilliamson39@yahoo.com
  Subject: Re: Getting
  In-Reply-To: <1359046624.26078.YahooMailNeo@web120904.mail.ne1.yahoo.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