Re: Negative LIMIT and OFFSET?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Jonah H. Harris" <jonah.harris@gmail.com>
Cc: "Andrew Sullivan" <ajs@crankycanuck.ca>, pgsql-hackers@postgresql.org
Date: 2007-12-14T03:56:14Z
Lists: pgsql-hackers
"Jonah H. Harris" <jonah.harris@gmail.com> writes:
> Don't we have any similar usability cases in the system like this,
> where negatives are not allowed only for the sake of it being an
> insane setting?  I'm tired, but I thought we did.

Yeah, probably.  It's the kind of thing where the call is close enough
that it might be made differently by different people.

After thinking about it for a bit, the only downside I can think of is
that throwing an error might create an unexpected corner case for code
that computes a LIMIT value on-the-fly and might sometimes come up
with a slightly negative value.  But you could always do
	LIMIT greatest(whatever, 0)
so that seems like a weak argument.

			regards, tom lane