Re: Negative LIMIT and OFFSET? - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Negative LIMIT and OFFSET?
Date
Msg-id 87r6hlq4f9.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Negative LIMIT and OFFSET?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Negative LIMIT and OFFSET?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> mysql> select * from t limit 2 offset -2;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
versionfor the right syntax to use near '-2' at line 1
 
>
> This behavior suggests that they can't even deal with LIMIT/OFFSET
> values that aren't simple integer literals ...

I suppose when they added these features I think they didn't have subqueries,
so there wasn't really much useful that could be done with arbitrary
expressions here. Being able to do "LIMIT 1+1" doesn't actually add anything.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Negative LIMIT and OFFSET?
Next
From: Tom Lane
Date:
Subject: Re: Negative LIMIT and OFFSET?