Re: wCTE behaviour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Yeb Havinga <yebhavinga(at)gmail(dot)com>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>
Subject: Re: wCTE behaviour
Date: 2010-11-14 21:44:24
Message-ID: 11483.1289771064@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sun, Nov 14, 2010 at 1:51 PM, Yeb Havinga <yebhavinga(at)gmail(dot)com> wrote:
>> What if CTE's ever get input parameters?

> Then they'd be functions, which we already have.

If you mean something like

prepare foo(int) as
with x as (delete from tab where id = $1 returning *)
insert into log_table select * from x;

I don't see that the parameter makes things any less well-defined.

If you mean a parameter in the sense of an executor parameter passed
in from a surrounding nestloop, that'd scare me too --- but I thought
we were going to disallow wCTEs except at the top level of a query,
so the case wouldn't arise.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yeb Havinga 2010-11-14 22:02:08 Re: wCTE behaviour
Previous Message Greg Stark 2010-11-14 21:40:17 Re: Rethinking hint bits WAS: Protecting against unexpected zero-pages: proposal