Re: Parsing ambiguity for ORDER BY ... NULLS FIRST/LAST

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Parsing ambiguity for ORDER BY ... NULLS FIRST/LAST
Дата
Msg-id 1168076800.3655.83.camel@silverbirch.site
обсуждение исходный текст
Ответ на Parsing ambiguity for ORDER BY ... NULLS FIRST/LAST  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Parsing ambiguity for ORDER BY ... NULLS FIRST/LAST  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, 2007-01-05 at 20:19 -0500, Tom Lane wrote:

> The only other solution I can see is to make use of the lookahead filter
> we already have in filtered_base_yylex() to combine NULLS FIRST and
> NULLS LAST into single tokens.  This is not an ideal solution: consider
> 
>     SELECT * FROM nulls first;
> 
> This should be considered a valid selection from a relation named "nulls"
> with alias "first", but if it's reduced to a single token the grammar
> will not see it that way, and will give an error.  However, that's a
> sufficiently unlikely scenario that maybe we can just ignore it.  (It's
> possible to work around the case by inserting AS, of course.)  We could
> probably fix it if we really had to, but it would involve some pretty
> ugly coding AFAICS.
> 
> BTW: the existing lookahead hack for WITH CASCADED etc. has the
> identical problem.

Since we already have that problem, it seems sensible to go that way
with the NULLS FIRST issue.

Presumably you could put extra grammar rules in to throw errors when you
see FROM NULLS FIRST? Or should we just document it, somewhere?

--  Simon Riggs              EnterpriseDB   http://www.enterprisedb.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: PGCon 2007 Program Committee
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: -f option for pg_dumpall