Re: return text from explain

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Willy-Bas Loos <willybas(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: return text from explain
Date: 2012-09-06 20:15:02
Message-ID: 25908.1346962502@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> On Thu, Sep 6, 2012 at 07:18:50PM +0200, Willy-Bas Loos wrote:
>> Is it possible to use the output of explain as text values?

> I think you have to do EXPLAIN in a function and call the function.

Yeah, IIRC you can use EXPLAIN as the source statement in a plpgsql
FOR loop, ie
FOR text_variable IN EXPLAIN ... LOOP
which gets you the output one line at a time.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kobus Wolvaardt 2012-09-06 20:34:39 pg_dump slow on windows
Previous Message Pavel Stehule 2012-09-06 19:24:35 Re: pivot functions with variable number of columns