pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #8061: Not count limit offset
3+ messages / 3 participants
[nested] [flat]
* BUG #8061: Not count limit offset
@ 2013-04-12 14:57 claudiomsi@hotmail.com
0 siblings, 2 replies; 3+ messages in thread
From: claudiomsi@hotmail.com @ 2013-04-12 14:57 UTC (permalink / raw)
To: pgsql-bugs
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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #8061: Not count limit offset
@ 2013-04-12 16:38 Dickson S. Guedes <listas@guedesoft.net>
parent: claudiomsi@hotmail.com
1 sibling, 0 replies; 3+ messages in thread
From: Dickson S. Guedes @ 2013-04-12 16:38 UTC (permalink / raw)
To: claudiomsi@hotmail.com; +Cc: pgsql-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.br
http://www.rnp.br/keyserver/pks/lookup?search=0x8F3E3C06D428D10A
Attachments:
signature.asc (application/pgp-signature, 489B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #8061: Not count limit offset
@ 2013-04-12 17:03 Tom Lane <tgl@sss.pgh.pa.us>
parent: claudiomsi@hotmail.com
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2013-04-12 17:03 UTC (permalink / raw)
To: claudiomsi@hotmail.com; +Cc: pgsql-bugs
claudiomsi@hotmail.com writes:
> select count(*) from teste; --- 5000
> select count(*) from teste limit 1000 offset 0; --- 5000
> select count(*) from teste limit 1000 offset 1; --- not returning
Of course. I think perhaps what you are looking for is
select count(*) from (select 1 from teste limit ...) ss;
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2013-04-12 17:03 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-04-12 14:57 BUG #8061: Not count limit offset claudiomsi@hotmail.com
2013-04-12 16:38 ` Dickson S. Guedes <listas@guedesoft.net>
2013-04-12 17:03 ` Tom Lane <tgl@sss.pgh.pa.us>
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