Re: Negative LIMIT and OFFSET?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: "Andrew Sullivan" <ajs(at)crankycanuck(dot)ca>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Negative LIMIT and OFFSET?
Date: 2007-12-14 03:56:14
Message-ID: 26698.1197604574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jonah H. Harris" <jonah(dot)harris(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2007-12-14 04:31:17 Re: Negative LIMIT and OFFSET?
Previous Message Andrew Sullivan 2007-12-14 03:21:59 Re: Negative LIMIT and OFFSET?