Skip site navigation (1) Skip section navigation (2)

Re: Token separation

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Token separation
Date: 2012-01-16 15:12:26
Message-ID: m3d3ajd6lh.fsf@passepartout.tim-landscheidt.de (view raw or flat)
Thread:
Lists: pgsql-sql
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

>> [ "0x13" is lexed as "0" then "x13" ]

>> Is this behaviour really conforming to the standard?

> Well, it's pretty much the universal behavior of flex-based lexers,
> anyway.  A token ends when the next character can no longer sensibly
> be added to it.

I know, but - off the top of my head - in most other lan-
guages "0abc" will then give a syntax error.

> Possibly the documentation should be tweaked to mention the
> number-followed-by-identifier case.

Especially if you consider such cases:

| tim=# SELECT 1D1; SELECT 1E1; SELECT 1F1;
|  d1
| ----
|   1
| (1 Zeile)

|  ?column?
| ----------
|        10
| (1 Zeile)

|  f1
| ----
|   1
| (1 Zeile)

| tim=#

I don't think it's common to hit this, but the documentation
surely could use a caveat.  I will write something up and
submit it to -docs.

Thanks,
Tim


In response to

Responses

pgsql-sql by date

Next:From: Gera Mel HandumonDate: 2012-01-17 06:31:02
Subject: UPDATE COMPATIBILITY
Previous:From: Alok ThakurDate: 2012-01-16 09:48:19
Subject: Re: sql query problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group