From: Dickson S. Guedes <listas@guedesoft.net>
To: claudiomsi@hotmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8061: Not count limit offset
Date: Fri, 12 Apr 2013 13:38:13 -0300
Message-ID: <1365784693.4410.42.camel@dba01> (raw)
In-Reply-To: <E1UQfPz-00054x-6D@wrigleys.postgresql.org>
References: <E1UQfPz-00054x-6D@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Em Sex, 2013-04-12 às 14:57 +0000, claudiomsi@hotmail.com escreveu:
> The following bug has been logged on the website:
>
> Bug reference: 8061
> Logged by: Claudio Oliveira
> Email address: claudiomsi@hotmail.com
> PostgreSQL version: 9.2.4
> Operating system: WIN 8
> Description:
>
> select count(*) from teste; --- 5000
> select count(*) from teste limit 1000 offset 0; --- 5000
> select count(*) from teste limit 1000 offset 1; --- not returning
From documentation [1]:
"OFFSET says to skip that many rows before beginning to return rows.
OFFSET 0 is the same as omitting the OFFSET clause, and LIMIT NULL is
the same as omitting the LIMIT clause. If both OFFSET and LIMIT appear,
then OFFSET rows are skipped before starting to count the LIMIT rows
that are returned."
Notice that a "select count(*) from ... " will return _one_ line.
[1] http://www.postgresql.org/docs/current/static/queries-limit.html
--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.brhttp://www.rnp.br/keyserver/pks/lookup?search=0x8F3E3C06D428D10AAttachments:
signature.asc (application/pgp-signature, 489B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: listas@guedesoft.net, claudiomsi@hotmail.com
Subject: Re: BUG #8061: Not count limit offset
In-Reply-To: <1365784693.4410.42.camel@dba01>
References: <E1UQfPz-00054x-6D@wrigleys.postgresql.org> <1365784693.4410.42.camel@dba01>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox