Re: Recursive query syntax ambiguity

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Recursive query syntax ambiguity
Дата
Msg-id 29102.1169846146@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Recursive query syntax ambiguity  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Recursive query syntax ambiguity  (Gregory Stark <stark@enterprisedb.com>)
Список 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 по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: No ~ operator for box, point
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_restore exclude schema from being droped option