pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andreas Karlsson <andreas@proxel.se>
Cc: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: David Fetter <david@fetter.org>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Early WIP/PoC for inlining CTEs
Date: Tue, 29 Jan 2019 14:52:44 -0500
Message-ID: <17787.1548791564@sss.pgh.pa.us> (raw)
In-Reply-To: <20190129045158.GD3121@paquier.xyz>
References: <20190111190403.77ye7m5mxypxsf4l@alap3.anarazel.de>
	<CA+TgmobVMPX1wJxPaRQ=FZBzp-AQ=JWK=bzxztqwj=MsOsrnrA@mail.gmail.com>
	<00818be9-2f63-f584-efcd-d97ee0662905@proxel.se>
	<CA+TgmoapASa3RQi=DuSikPoPF4363czSD8KxbOxsfW5XmO3WpQ@mail.gmail.com>
	<5715d93e-6ebc-be17-c2c3-56a873100a38@proxel.se>
	<29576.1548084476@sss.pgh.pa.us>
	<CA+TgmoYZYj8eLdV9AcROtmPW4AJA7ANh3xQh7BcafaPfCnmv+g@mail.gmail.com>
	<12408.1548707732@sss.pgh.pa.us>
	<c16909ed-0789-5199-f315-!5433d83a0026@2ndquadrant.com>
	<32184.1548713132@sss.pgh.pa.us>
	<20190129045158.GD3121@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Jan 28, 2019 at 05:05:32PM -0500, Tom Lane wrote:
>> Yeah, I thought about that too, but it doesn't seem like an improvement.
>> If the query is very long (which isn't unlikely) I think people would
>> prefer to see the option(s) up front.

> Having these options at the front of the WITH clause looks more
> natural to me.

Well, we've managed to get agreement on the semantics of this thing,
let's not get hung up on the syntax details.

I propose that we implement and document this as

	WITH ctename AS [ MATERIALIZE { ON | OFF } ] ( query )

which is maybe a bit clunky but not awful, and it would leave room
to generalize it to "AS [ optionname optionvalue [ , ... ] ]" if we
ever need to.  Looking at the precedent of e.g. EXPLAIN, we could
probably allow just "MATERIALIZE" as well, with the boolean value
defaulting to true.

			regards, tom lane




view thread (112+ messages)  latest in thread

Message-ID: <17787.1548791564@sss.pgh.pa.us>
Permalink:  ../17787.1548791564@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17787.1548791564@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, peter.eisentraut@2ndquadrant.com, robertmhaas@gmail.com, andreas@proxel.se, andres@anarazel.de, thomas.munro@enterprisedb.com, andrew@tao11.riddles.org.uk, david@fetter.org
  Subject: Re: Early WIP/PoC for inlining CTEs
  In-Reply-To: <17787.1548791564@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox