Re: Negative LIMIT and OFFSET?

Gregory Stark <stark@enterprisedb.com>

From: Gregory Stark <stark@enterprisedb.com>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: "Bruce Momjian" <bruce@momjian.us>, "Simon Riggs" <simon@2ndquadrant.com>, <pgsql-hackers@postgresql.org>
Date: 2007-12-17T05:24:42Z
Lists: 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 version for 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!