Re: [HACKERS] Re: Regress tests reveal *serious* psql bug - Mailing list pgsql-hackers

From Adriaan Joubert
Subject Re: [HACKERS] Re: Regress tests reveal *serious* psql bug
Date
Msg-id 387C3ABA.BC071D19@albourne.com
Whole thread Raw
In response to Re: [HACKERS] Re: Regress tests reveal *serious* psql bug  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] BlowAwayRelationBuffers
Next
From: Adriaan Joubert
Date:
Subject: Re: [HACKERS] BlowAwayRelationBuffers