On Mon, Aug 17, 2015 at 10:22:11AM -0700, Josh Berkus wrote: > > > EXPLAIN [ANALYZE] > > Would be tricky. We don't currently have any way to wrap an EXPLAIN > in any larger statement, do we?
We do, but it's kinda horrible. CREATE OR REPLACE FUNCTION get_something_from_explain(your_query) RETURNS TEXT LANGUAGE plpgsql /* uh oh */ AS $$ DECLARE foo JSON; BEGIN EXECUTE format('EXPLAIN (FORMAT json), your_query) INTO foo; RETURN foo #>> '{bar,baz,quux}'; END; $$; > Would be very useful for automated query analysis, though. Among many other things, certainly :) > > SHOW > > Not very useful, easy to work around (pg_settings). This particular one is just about being consistent, or the way I look at it, about avoiding surprising users with inconsistencies. Cheers, David. -- David Fetter <da...@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers