Re: Select count with offset returns nothing. - Mailing list pgsql-general

From Tom Lane
Subject Re: Select count with offset returns nothing.
Date
Msg-id 2712.1312557416@sss.pgh.pa.us
Whole thread Raw
In response to Select count with offset returns nothing.  (Tim Uckun <timuckun@gmail.com>)
List pgsql-general
Tim Uckun <timuckun@gmail.com> writes:
> I am using a library which is emitting SQL like this  SELECT COUNT(*)
> FROM batches LIMIT 15 OFFSET 15 the library fails because on postgres
> this query returns nothing (not even zero as a result). Presumably it
> returns some valid value on mysql and other databases.

FWIW, I just tried it on mysql 5.5.2, and got results similar to
Postgres: the limit/offset are considered to apply to the single
aggregated row, not the aggregate's input rows as that library
seems to be expecting.  I wonder what database they were using
for testing ...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Temp table visibility
Next
From: Daniel Winterstein
Date:
Subject: Can GiST for tsvector be optimised? #TextSearch