BUG #13754: Postgres possibly accepts a typo as valid input

From: ryan(dot)vilim(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13754: Postgres possibly accepts a typo as valid input
Date: 2015-11-03 19:59:49
Message-ID: 20151103195949.2747.55003@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13754
Logged by: Ryan Vilim
Email address: ryan(dot)vilim(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Gould 2015-11-03 22:10:06 Re: BUG #13750: Autovacuum slows down with large numbers of tables. More workers makes it slower.
Previous Message Tom Lane 2015-11-03 17:03:51 Re: BUG #13753: Docs for plpy.execute() miss info about quoting