Re: Recursive query syntax ambiguity

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Recursive query syntax ambiguity
Date: 2007-01-26 21:01:23
Message-ID: 20070126210123.GE24276@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ok, looking at your example:

WITH RECURSIVE foo (a,b) AS (subq) SEARCH BREADTH FIRST BY a,b , c(x,z),d(y,z) AS (subq) SELECT ...

What you're trying to say is that the c is a <with list element>,
not a <cycle column>. But the parser will see that as soon as it hits
the open parenthesis, since a <cycle column> is always just a column
name.

Also, the AS is the <with list element> doesn't appear to be optional,
I assume you left that out after the c(x,z) for clarity.

I think bison should be able to handle this as long as the "name" in
common_table_expression matches exactly the same things as whatever
columnList uses. It can the merge the two parse paths, allowing it to
"see" further.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2007-01-26 21:07:45 Re: [HACKERS] how to plan for vacuum?
Previous Message Gevik Babakhani 2007-01-26 20:50:30 Re: VC2005 build and pthreads