Re: More WITH
От | David Fetter |
---|---|
Тема | Re: More WITH |
Дата | |
Msg-id | 20150817173752.GC32300@fetter.org обсуждение исходный текст |
Ответ на | Re: More WITH (Josh Berkus <josh@agliodbs.com>) |
Список | pgsql-hackers |
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 <david@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate
В списке pgsql-hackers по дате отправления: