Thread: BUG #8061: Not count limit offset
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 =
Em Sex, 2013-04-12 =C3=A0s 14:57 +0000, claudiomsi@hotmail.com escreveu: > The following bug has been logged on the website: >=20 > Bug reference: 8061 > Logged by: Claudio Oliveira > Email address: claudiomsi@hotmail.com > PostgreSQL version: 9.2.4 > Operating system: WIN 8 > Description: =20 >=20 > select count(*) from teste; --- 5000 > select count(*) from teste limit 1000 offset 0; --- 5000 > select count(*) from teste limit 1000 offset 1; --- not returning=20 =46rom 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 --=20 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=3D0x8F3E3C06D428D10A
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