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

Re: [HACKERS] WITH RECURSIVE patches 0818

From: David Fetter <david(at)fetter(dot)org>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] WITH RECURSIVE patches 0818
Date: 2008-08-19 05:14:14
Message-ID: 20080819051414.GI7447@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Mon, Aug 18, 2008 at 04:38:52PM +0900, Tatsuo Ishii wrote:
> Hi,
> 
> Here is the latest WITH RECURSIVE patches against CVS HEAD. Besides
> syncing to CVS HEAD, followings are main differences from previous
> one:

Thanks for the new patch :)

I think I may have found another bug:

WITH RECURSIVE t(i,j) AS (
    VALUES (1,2)
UNION ALL
    SELECT t2.i, t.j
    FROM (
        SELECT 2 AS i
    UNION ALL               /* Wrongly getting detected, I think */
        SELECT 3 AS i
    ) AS t2
    JOIN
        t
        ON (t2.i = t.i)
)
SELECT * FROM t;
ERROR:  attribute number 2 exceeds number of columns 1

Is there some way to ensure that in the case of WITH RECURSIVE, the
query to the right of UNION ALL follows only the SQL:2008 rules about
not having outer JOINs, etc. in it, but otherwise make it opaque to
the error-checking code?

I know I didn't explain that well, but the above SQL should work and
the error appears to stem from the parser's looking at the innermost
UNION ALL instead of the outermost.

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: K, Niranjan (NSN - IN/Bangalore)Date: 2008-08-19 07:03:30
Subject: Re: Postgres-R
Previous:From: ITAGAKI TakahiroDate: 2008-08-19 05:06:04
Subject: Publish GUC flags to custom variables

pgsql-patches by date

Next:From: Tatsuo IshiiDate: 2008-08-19 07:49:55
Subject: Re: [HACKERS] WITH RECURSIVE patches 0818
Previous:From: Tatsuo IshiiDate: 2008-08-18 07:38:52
Subject: WITH RECURSIVE patches 0818

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