Re: Writeable CTEs and empty relations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Writeable CTEs and empty relations
Date
Msg-id 20913.1266028316@sss.pgh.pa.us
Whole thread Raw
In response to Re: Writeable CTEs and empty relations  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Writeable CTEs and empty relations
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Feb 12, 2010 at 8:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> We could possibly put in some hack to disallow OLD/NEW references in
>> the WITH queries, but that got past my threshold of ugliness, so
>> I'm not going to commit it without further discussion.

> On the face of it it's not obvious to me why you wouldn't just do
> that.  If it's not valid to reference them there, then just don't let
> it happen (now comes the part where you tell me why it's not that
> simple).

Well, there's no obvious-to-the-user reason why it shouldn't work.
If we hack it, then an example like I gave will give a "no such
table" error, and I'll bet long odds we'll get bug reports about it.

(Now maybe we could suppress the bug reports if we could get it to
print something more like "NEW can't be referenced in WITH", but
doing that seems significantly harder --- the way that I can see
to do it would be to not have NEW/OLD in the namespace while parsing
WITH, and that would lead to a pretty stupid error message.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: knngist patch support
Next
From: Tom Lane
Date:
Subject: Re: Patch: Remove gcc dependency in definition of inline functions