Re: Common Table Expressions (WITH RECURSIVE) patch - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Common Table Expressions (WITH RECURSIVE) patch
Date
Msg-id 603c8f070809082201t21a80b2aqb195e0e7b425776e@mail.gmail.com
Whole thread Raw
In response to Re: Common Table Expressions (WITH RECURSIVE) patch  (Tatsuo Ishii <ishii@sraoss.co.jp>)
List 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


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch
Next
From: Greg Smith
Date:
Subject: Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number]