cool, it does work with RETURN QUERY.
Thanx!
WBL
On Fri, Sep 7, 2012 at 11:00 AM, Виктор Егоров <vyegorov(at)gmail(dot)com> wrote:
> Hope this helps:
>
> CREATE OR REPLACE FUNCTION explain(in_sql text) RETURNS TABLE(explain_line
> text) AS $explain$
> BEGIN
> RETURN QUERY EXECUTE 'EXPLAIN '||in_sql;
> END;
> $explain$ LANGUAGE plpgsql;
>
> SELECT * FROM explain('SELECT * FROM pg_locks');
>
>
> --
> Victor Y. Yegorov
>
--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth