Re: SQL standard question about Common Table Expressions - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: SQL standard question about Common Table Expressions
Date
Msg-id 1220935524.12678.151.camel@jdavis
Whole thread Raw
In response to Re: SQL standard question about Common Table Expressions  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
On Tue, 2008-09-09 at 01:45 +0100, Andrew Gierth wrote:
> The "contains" language in the spec is tricky. And I think there's some
> issue here with the spec confusing <query expression> and <query
> expression body>; some of the language refers to "If a <query expression>
> AQEk not marked as recursive is immediately contained in a <query
> expression body>" which is not possible as the syntax production for
> <query expression body> does not contain <query expression>.

Now that you point that out, I think that is a mistake in the spec. Your
version makes a lot more sense.

Thank you for going into the gory details of the algorithm, there were a
few other things tripping me up that you clarified.

I was going crazy yesterday trying to piece together what is supposed to
happen for, e.g., using INTERSECT to connect the recursive and the
non-recursive parts, and this answers it. I'm not suggesting that we
require support for INTERSECT, but my curiosity got the best of me.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Joshua Drake
Date:
Subject: Re: [PATCH] Cleanup of GUC units code
Next
From: Tatsuo Ishii
Date:
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch