getting EXPLAIN output from inside a function

From: Joseph S <jks(at)selectacast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: getting EXPLAIN output from inside a function
Date: 2011-04-21 18:41:06
Message-ID: iopto2$1dc9$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I saw this in the mailing list archives without an answer, so for future
reference:

DECLARE
...
line TEXT;
BEGIN
...
FOR line IN EXECUTE ''EXPLAIN ANALYZE <statement goes here> LOOP
RAISE NOTICE ''% '' , line;
END LOOP;

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2011-04-21 20:08:46 Re: SSDs with Postgresql?
Previous Message Karsten Hilbert 2011-04-21 18:07:33 Re: problem with parent/child table and FKs