Re: [HACKERS] Re: Regress tests reveal *serious* psql bug

Поиск
Список
Период
Сортировка
От Adriaan Joubert
Тема Re: [HACKERS] Re: Regress tests reveal *serious* psql bug
Дата
Msg-id 387C3ABA.BC071D19@albourne.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: Regress tests reveal *serious* psql bug  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I think we can live with requiring a variable name to start with an
> > alphabetic or underscore.
>
> >       SELECT a[1:2]
>
> > is clear and
>
> >       SELECT a[1:myvar]
>
> > expands to SELECT a[1].
>
> No go --- SELECT a[1:b] where b is a field name is a valid query
> currently.

The colon in array syntax is quite a special case. It should be relatively
easy to figure out whether you are in a construct of the form
[<token>:<token>]. And then there should be no problem in figuring out that
in
[1:b] b refers to a column and in [1::b] ':b' is a variable. Do colons
apear anywhere else?

Btw, i agree that variables should start with a letter and by default
variables have to be declared.

Adriaan



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] BlowAwayRelationBuffers
Следующее
От: Adriaan Joubert
Дата:
Сообщение: Re: [HACKERS] BlowAwayRelationBuffers