Re: [HACKERS] oversight in EphemeralNamedRelation support - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] oversight in EphemeralNamedRelation support
Date
Msg-id 29994.1507837851@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] oversight in EphemeralNamedRelation support  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: [HACKERS] oversight in EphemeralNamedRelation support
List pgsql-hackers
Julien Rouhaud <rjuju123@gmail.com> writes:
> On Mon, Oct 9, 2017 at 10:43 PM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>> I suppose we could consider moving the schemaname check into
>> getRTEForSpecialRelationType(), since otherwise both callers need to
>> do that (and as you discovered, one forgot).

> Thanks for the feedback.  That was my first idea, but I assumed there
> could be future use for this function on qualified RangeVar if it
> wasn't done this way.

> I agree it'd be much safer, so v2 attached, check moved in
> getRTEForSpecialRelationType().

Hm.  I actually think the bug here is that 18ce3a4ab introduced
anything into setTargetTable at all.  There was never previously
any assumption that the target could be anything but a regular
table, so we just ignored CTEs there, and I do not think the
new behavior is an improvement.

So my proposal is to rip out the getRTEForSpecialRelationTypes
check there.  I tend to agree that getRTEForSpecialRelationTypes
should probably contain an explicit check for unqualified name
rather than relying on its caller ... but that's a matter of
future-proofing not a bug fix.
        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] [POC] hash partitioning
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] [POC] hash partitioning