[HACKERS] Behavior of OFFSET -1

2014-07-22 Thread Tom Lane
Before 9.3, you got an error from this: regression=# select * from tenk1 offset -1; ERROR: OFFSET must not be negative But 9.3 and up ignore the negative OFFSET. This seems to be a thinko in my commit 1a1832eb. limit_needed() thinks it can discard the Limit plan node altogether, which of

Re: [HACKERS] Behavior of OFFSET -1

2014-07-22 Thread Robert Haas
On Tue, Jul 22, 2014 at 12:49 PM, Tom Lane t...@sss.pgh.pa.us wrote: Before 9.3, you got an error from this: regression=# select * from tenk1 offset -1; ERROR: OFFSET must not be negative But 9.3 and up ignore the negative OFFSET. This seems to be a thinko in my commit 1a1832eb.

Re: [HACKERS] Behavior of OFFSET -1

2014-07-22 Thread David Fetter
On Tue, Jul 22, 2014 at 12:49:37PM -0400, Tom Lane wrote: Before 9.3, you got an error from this: regression=# select * from tenk1 offset -1; ERROR: OFFSET must not be negative That seems eminently sane, and should continue to error out, IM. The only circumstance I can imagine where this