Skip site navigation (1) Skip section navigation (2)

Re: WITH RECURSIVE patch V0.1

From: David Fetter <david(at)fetter(dot)org>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>,PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH RECURSIVE patch V0.1
Date: 2008-05-18 18:47:37
Message-ID: 20080518184736.GB17374@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Sun, May 18, 2008 at 08:51:29PM +0900, Tatsuo Ishii wrote:
> WITH RECURSIVE patch V0.1
> 
> Here are patches to implement WITH RECURSIVE clause. There are some
> limitiations and TODO items(see the "Current limitations" section
> below). Comments are welcome.
> 
> 1. Credit
> 
> These patches were developed by Yoshiyuki Asaba (y-asab(at)sraoss(dot)co(dot)jp)
> with some discussions with Tatsuo Ishii (ishii(at)sraoss(dot)co(dot)jp).

This is really great!  Kudos to all who made this happen :)

I tried a bunch of different queries, and so far, only these two
haven't worked.  Any ideas what I'm doing wrong here?

WITH RECURSIVE t(n) AS (
    SELECT 1
UNION ALL
    SELECT n+1
    FROM t
    WHERE n < 100
)
SELECT * FROM t;
ERROR:  cannot extract attribute from empty tuple slot

WITH RECURSIVE t(n) AS (
    VALUES (1)
UNION ALL
    SELECT n+1
    FROM t
    WHERE n < 100
)
SELECT * FROM t;
ERROR:  cannot extract attribute from empty tuple slot

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2008-05-18 20:00:43
Subject: notification information functions
Previous:From: Andrew DunstanDate: 2008-05-18 18:45:26
Subject: Re: ignore $PostgreSQL lines in regression tests?

pgsql-patches by date

Next:From: Dave PageDate: 2008-05-18 21:16:17
Subject: Re: odd output in restore mode
Previous:From: Andrew ChernowDate: 2008-05-18 14:33:24
Subject: Re: libpq object hooks (libpq events)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group