pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Fetter <david@fetter.org>
To: Tatsuo Ishii <ishii@postgresql.org>
Cc: pgsql-patches@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] WITH RECURSIVE patches 0818
Date: Mon, 18 Aug 2008 22:14:14 -0700
Message-ID: <20080819051414.GI7447@fetter.org> (raw)
In-Reply-To: <20080818.163852.105172778.t-ishii@sraoss.co.jp>
References: <20080818.163852.105172778.t-ishii@sraoss.co.jp>

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@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

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



view thread (7+ messages)  latest in thread

Message-ID: <20080819051414.GI7447@fetter.org>
Permalink:  ../20080819051414.GI7447@fetter.org/
Also on:    postgresql.org/message-id/20080819051414.GI7447@fetter.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: david@fetter.org, ishii@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] WITH RECURSIVE patches 0818
  In-Reply-To: <20080819051414.GI7447@fetter.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox