Search Postgresql Archives

Re: return text from explain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep  6, 2012 at 07:18:50PM +0200, Willy-Bas Loos wrote:
> Hi,
> 
> Is it possible to use the output of explain as text values?
> This won't work:
> 
> explain select *
> from (values (1),(2),(3)) foo(x)
> where x > 2
> 
> What i really want is to explain analyze a dynamic query that i build up in a
> function.
> If it returns a value i can do stuff with it, but i can't find out how to grasp
> the query plan as a value.
> 
> pgAdmin shows it as text values in the data output tab, but that might be a
> hack outside the database realm.

I think you have to do EXPLAIN in a function and call the function.  My
CTE presentation has an example of that:

	http://momjian.us/main/presentations/features.html#cte

-- 
  Bruce Momjian  <bruce@xxxxxxxxxx>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux