Re: Recursive query syntax ambiguity - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Recursive query syntax ambiguity
Date
Msg-id 29102.1169846146@sss.pgh.pa.us
Whole thread Raw
In response to Re: Recursive query syntax ambiguity  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Recursive query syntax ambiguity  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> Er, CYCLE isn't a binary operator, and users can't make binary
> operators that are words, so I'm not sure of the problem here.

Well, the problem typically is not being able to tell whether an
operator is supposed to be infix or postfix; hence keywords that can
terminate arbitrary expressions usually have to be reserved words.
However, now that I look at the syntax I think Greg may be misreading
it.  I see

<search or cycle clause> ::=  <search clause>| <cycle clause>| <search clause> <cycle clause>

<search clause> ::=SEARCH <recursive search order> SET <sequence column>

<recursive search order> ::=  DEPTH FIRST BY <sort specification list>| BREADTH FIRST BY <sort specification list>

<sequence column> ::= <column name>

<cycle clause> ::=  CYCLE <cycle column list> SET <cycle mark column> TO <cycle  mark value> DEFAULT <non-cycle mark
value>USING <path column>
 

<cycle column list> ::= <cycle column> [ {<comma><cycle column>}...]

<cycle column> ::= <column name>

<cycle mark column> ::= <column name>

<path column> ::= <column name>

<cycle mark value> ::= <value expression>

<non-cycle mark value> ::= <value expression>

and so CYCLE would come *after* "SET <sequence column>" not before it.
It looks to me like we'd have to promote SET to fully reserved status,
but that probably isn't going to surprise anyone.  DEFAULT and USING
already are fully reserved.  I don't see anything else here that looks
like it should need to be reserved.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: No ~ operator for box, point
Next
From: Tom Lane
Date:
Subject: Re: pg_restore exclude schema from being droped option