Re: [BUGS] Possible Bug in 9.2beta3

2012-08-15 Thread Tom Lane
Adam Mackler writes: > On Wed, Aug 15, 2012 at 12:53 PM, Tom Lane wrote: >> Right offhand I'm inclined to think that the reference to "iter" >> inside the first sub-WITH ought to be disallowed. I don't recall >> the exact rules about where a recursive reference can appear, but >> it sure doesn't

Re: [BUGS] Possible Bug in 9.2beta3

2012-08-15 Thread Adam Mackler
Are you asking me or the other experts? I had not even heard of a common table expression a few weeks ago, so I doubt I'm qualified to opine what ought to be possible; I just know what I'm trying to do. Basically I've got a recursive CTE with rows, some of which have information that I want to be

Re: [BUGS] Possible Bug in 9.2beta3

2012-08-15 Thread Tom Lane
Adam Mackler writes: > WITH RECURSIVE > tab(id_key,link) AS ( VALUES (1,17), (2,17), (3,17), (4,17), (6,17), (5,17) ), > iter (id_key, row_type, link) AS ( > SELECT 0, 'base', 17 > UNION( > WITH remaining(id_key, row_type, link, min) AS ( > SELECT tab.id_key, 'true'::text, iter.lin

Re: [BUGS] Possible Bug in 9.2beta3

2012-08-13 Thread Greg Stark
On Mon, Aug 13, 2012 at 7:17 PM, Adam Mackler wrote: > > Next, uncomment the final UNION four lines from the end. When I do > that I then get a two row result. I'm not an expert on recursive > CTEs, but I don't believe a UNION should decrease the number of rows > returned. I haven't dug through

[BUGS] Possible Bug in 9.2beta3

2012-08-13 Thread Adam Mackler
Hi: I think I might have found a bug in the 9.2beta3 version. I'm kind of new to SQL, so forgive me if I'm just misinterpreting correct behavior. Given the query below, execute it. You should get a seven-row result. Next, uncomment the final UNION four lines from the end. When I do that I the