Re: oversight in EphemeralNamedRelation support

Thomas Munro <thomas.munro@enterprisedb.com>

From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Julien Rouhaud <rjuju123@gmail.com>, PG Hackers <pgsql-hackers@postgresql.org>, Hugo Mercier <hugo.mercier@oslandia.com>, Kevin Grittner <kgrittn@gmail.com>
Date: 2017-10-15T10:48:34Z
Lists: pgsql-hackers
On Fri, Oct 13, 2017 at 10:01 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> But I see very
> little case for allowing CTEs to capture such references, because surely
> we are never going to allow that to do anything useful, and we have
> several years of precedent now that they don't capture.

For what it's worth, SQL Server allows DML in CTEs like us but went
the other way on this.  Not only are its CTEs in scope as DML targets,
it actually lets you update them in cases where a view would be
updatable, rewriting as base table updates.  I'm not suggesting that
we should do that too (unless of course it shows up in a future
standard), just pointing it out as a curiosity.

-- 
Thomas Munro
http://www.enterprisedb.com


Commits

  1. Fix incorrect handling of CTEs and ENRs as DML target relations.