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

Re: [8.4] Updated WITH clause patch (non-recursive)

From: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
To: neilc(at)samurai(dot)com
Cc: pgsql-patches(at)postgresql(dot)org, stark(at)enterprisedb(dot)com
Subject: Re: [8.4] Updated WITH clause patch (non-recursive)
Date: 2008-03-25 04:30:53
Message-ID: 20080325.133053.1947374611.y-asaba@sraoss.co.jp (view raw or flat)
Thread:
Lists: pgsql-patches
Hi,

From: Neil Conway <neilc(at)samurai(dot)com>
Subject: [PATCHES] [8.4] Updated WITH clause patch (non-recursive)
Date: Sat, 26 Jan 2008 23:58:40 -0800

> Attached is an updated version of Greg Stark's patch to add support for
> the non-recursive variant of the SQL99 WITH clause[1].

I found a bug with the following SQL.

postgres=# WITH x AS (SELECT 1), y AS (SELECT 2)
 SELECT * FROM x UNION ALL SELECT * FROM y;
ERROR:  relation "x" does not exist

Attached patch transforms WITH clause in transformSetOperationStmt().
It works correctly with the attached patch.

postgres=# WITH x AS (SELECT 1), y AS (SELECT 2)
 SELECT * FROM x UNION ALL SELECT * FROM y;
 ?column? 
----------
        1
        2
(2 rows)

Regards,
--
Yoshiyuki Asaba
y-asaba(at)sraoss(dot)co(dot)jp

In response to

pgsql-patches by date

Next:From: Tom LaneDate: 2008-03-25 07:37:40
Subject: Re: Re: int8/float8/time/timestamp[tz]/float4 passed by value, was Re: Fix HAVE_LONG[_LONG]_INT_64 to really define to 1
Previous:From: Bruce MomjianDate: 2008-03-25 03:03:42
Subject: Re: 2WRS [WIP]

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