Select count with offset returns nothing.

From: Tim Uckun <timuckun(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Select count with offset returns nothing.
Date: 2011-08-05 10:51:24
Message-ID: CAGuHJrNz+AfJTjEv1fkd2k3uod0XBK9GspnTMJKtDRe125Afxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Other than hacking the library is there anything I can do?

Oddly enough SELECT count(*) FROM batches LIMIT 15 returns the full
count of the table. Presumably the count has to be done on a subquery
right?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Winterstein 2011-08-05 10:58:54 Can GiST for tsvector be optimised? #TextSearch
Previous Message Condor 2011-08-05 10:48:53 Postgresql problem with update double precision