Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id 0812D475AF3 for ; Wed, 10 Jul 2002 21:51:13 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g6B1ojh18807; Wed, 10 Jul 2002 21:50:45 -0400 (EDT) From: Bruce Momjian Message-Id: <200207110150.g6B1ojh18807@candle.pha.pa.us> Subject: Re: How to get total number of rows when using LIMIT/OFFSET? In-Reply-To: <15660.10182.92232.720222@cayambe.core.aeccom.com> To: Dirk Lutzebaeck Date: Wed, 10 Jul 2002 21:50:45 -0400 (EDT) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200207/149 X-Sequence-Number: 8528 Dirk Lutzebaeck wrote: > > Hello, > > when using LIMIT/OFFSET is it possible to get also the total number of rows > besides the actual number of rows of the select? It should be there > because the whole list is ordered anyhow. I'm using 7.2.1. No way to do that. Perhaps a CURSOR and look at the total count. Not sure if that works but I think it should. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026