Re: Review: UNNEST (and other functions) WITH ORDINALITY

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Review: UNNEST (and other functions) WITH ORDINALITY
Дата
Msg-id CA+TgmoZUneXCgO3HgjpOMog4gxTerYExyzxK=SXHmHvd0umGMQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Review: UNNEST (and other functions) WITH ORDINALITY  (Greg Stark <stark@mit.edu>)
Ответы Re: Review: UNNEST (and other functions) WITH ORDINALITY  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
On Fri, Jul 19, 2013 at 1:50 PM, Greg Stark <stark@mit.edu> wrote:
> My only reservation with this patch is whether the WITH_ORDINALITY
> parser hack is the way we want to go. The precedent was already set
> with WITH TIME ZONE though and I think this was the best option.

I share this reservation.  Lexer hacks are reasonable ways of getting
LALR(2)-ish behavior in very simple cases, but it doesn't take much to
get into trouble.  I think the with ordinality as (select 1) select *
from ordinality example you posted is precisely on point.  Currently,
we will have four classes of keywords: unreserved, column-name,
type-function, and reserved.  There are rules for when each of those
types of keywords needs to be quoted, and those rules are relatively
well-understood.

This patch will introduce, without documentation, a fifth class of
keyword.  ORDINALITY will need to be quoted when, and only when, it
immediately follows WITH.  Without some change to our deparsing code,
this is a dump/restore hazard; and with some such change it's still
probably not a good idea.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Review: UNNEST (and other functions) WITH ORDINALITY
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Review: UNNEST (and other functions) WITH ORDINALITY