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

From Tom Lane
Subject Re: Negative LIMIT and OFFSET?
Date
Msg-id 26698.1197604574@sss.pgh.pa.us
Whole thread Raw
In response to Re: Negative LIMIT and OFFSET?  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Responses Re: Negative LIMIT and OFFSET?  (Gregory Stark <stark@enterprisedb.com>)
List 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 doLIMIT greatest(whatever, 0)
so that seems like a weak argument.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Negative LIMIT and OFFSET?
Next
From: "Merlin Moncure"
Date:
Subject: Re: Negative LIMIT and OFFSET?