BUG #5193: should "select * from ab limitkkk" cause a syntax error?

Started by donniehanover 16 years ago2 messagesbugs
Jump to latest
#1donniehan
donniehan@126.com

The following bug has been logged online:

Bug reference: 5193
Logged by:
Email address: donniehan@126.com
PostgreSQL version: 8.4.1
Operating system: Windows XP
Description: should "select * from ab limitkkk" cause a syntax error?
Details:

Hi guys,

The following sql statement is not illegal

But pg can run it.

postgres=# select * from a limitkkk; ---->(seems equal "limit null")
a
---
1
1
1
1
1
(5 rows)

Should pg throws a syntax error?

Regards
-Dongni

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: donniehan (#1)
Re: BUG #5193: should "select * from ab limitkkk" cause a syntax error?

"" <donniehan@126.com> writes:

postgres=# select * from a limitkkk; ---->(seems equal "limit null")

Should pg throws a syntax error?

If we did, we'd be violating the SQL standard. The "limitkkk"
is a perfectly valid table alias. There's no AS in front of it,
but unfortunately the spec allows and even encourages people to
omit AS.

regards, tom lane