BUG #13754: Postgres possibly accepts a typo as valid input - Mailing list pgsql-bugs

From ryan.vilim@gmail.com
Subject BUG #13754: Postgres possibly accepts a typo as valid input
Date
Msg-id 20151103195949.2747.55003@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #13754: Postgres possibly accepts a typo as valid input
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13754
Logged by:          Ryan Vilim
Email address:      ryan.vilim@gmail.com
PostgreSQL version: 9.4.1
Operating system:   Mac
Description:

I recently found that postgres will accept the

SELECT -144mycol

to be equivalent to

SELECT -144 AS mycol.

As long as the first bits work out to be numbers it accepts it. For example,
it will also interpret

SELECT FLOOR(-144.4)*4mycol

as

SELECT FLOOR(144.4)*4 as mycol

I haven't been able to find any other references to this being standard SQL.
I think it might be a bug in postgres.

Ryan

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #13750: Autovacuum slows down with large numbers of tables. More workers makes it slower.
Next
From: Haribabu Kommi
Date:
Subject: Re: BUG #13741: vacuumdb does not accept valid password