Re: Common Table Expressions (WITH RECURSIVE) patch

From: "Robert Haas" <robertmhaas(at)gmail(dot)com>
To: "Tatsuo Ishii" <ishii(at)sraoss(dot)co(dot)jp>
Cc: pgsql(at)j-davis(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch
Date: 2008-09-09 05:01:12
Message-ID: 603c8f070809082201t21a80b2aqb195e0e7b425776e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> * Single Evaluation:
>>
>> with
>> foo(i) as (select random() as i)
>> select * from foo union all select * from foo;
>> i
>> -------------------
>> 0.233165248762816
>> 0.62126633618027
>> (2 rows)
>>
>> The standard specifies that non-recursive WITH should be evaluated
>> once.
>
> What shall we do? I don't think there's a easy way to fix this. Maybe
> we should not allow WITH clause without RECURISVE?

ISTM that kind of misses the point. Even if it's WITH RECURSIVE
rather than simply WITH, one wouldn't expect multiple evaluations of
any non-recursive portion of the query.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2008-09-09 05:43:06 Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number]
Previous Message Tatsuo Ishii 2008-09-09 04:49:00 Re: Common Table Expressions (WITH RECURSIVE) patch