Re: oversight in EphemeralNamedRelation support

Julien Rouhaud <rjuju123@gmail.com>

From: Julien Rouhaud <rjuju123@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>, PG Hackers <pgsql-hackers@postgresql.org>, Hugo Mercier <hugo.mercier@oslandia.com>, Kevin Grittner <kgrittn@gmail.com>
Date: 2017-10-13T06:09:04Z
Lists: pgsql-hackers
On Fri, Oct 13, 2017 at 5:22 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> On Fri, Oct 13, 2017 at 12:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Yeah, I agree --- personally I'd never write a query like that.  But
>>> the fact that somebody ran into it when v10 has been out for barely
>>> a week suggests that people are doing it.
>
>> Not exactly -- Julien's bug report was about a *qualified* reference
>> being incorrectly rejected.
>
> Nonetheless, he was using a CTE name equivalent to the name of the
> query's target table.  That's already confusing IMV ... and it does
> not seem unreasonable to guess that he only qualified the target
> because it stopped working unqualified.

FWIW, the original (and much more complex) query Hugo sent me was
inserting data in a qualified table name (the schema wasn't public,
and I assume not in his search_path).


Commits

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