Re: More WITH

From: David Fetter <david(at)fetter(dot)org>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: More WITH
Date: 2015-08-17 17:37:52
Message-ID: 20150817173752.GC32300@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-08-17 17:40:20 Re: Configure with thread sanitizer fails the thread test
Previous Message Alvaro Herrera 2015-08-17 17:31:24 Re: Configure with thread sanitizer fails the thread test