Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9834A6335B4 for ; Mon, 25 May 2009 11:15:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 42104-09 for ; Mon, 25 May 2009 11:15:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from powercell.magehandbook.com (173-8-4-45-WashingtonDC.hfc.comcastbusiness.net [173.8.4.45]) by mail.postgresql.org (Postfix) with ESMTP id 945E26334EE for ; Mon, 25 May 2009 11:15:52 -0300 (ADT) Received: from [192.168.1.50] (Mac-Pro.magehandbook.com [192.168.1.50]) by powercell.magehandbook.com (Postfix) with ESMTP id 4D13D285F2 for ; Mon, 25 May 2009 10:15:50 -0400 (EDT) Date: Mon, 25 May 2009 10:15:50 -0400 From: Daniel Staal Reply-To: PGSQL-Novice To: pgsql-novice@postgresql.org Subject: Re: Obtaining a limited number of records from a long query Message-ID: In-Reply-To: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt> References: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=RDNS_DYNAMIC=0.1 X-Spam-Level: X-Archive-Number: 200905/86 X-Sequence-Number: 21446 --As of May 25, 2009 2:32:14 PM +0100, Oliveiros Cristina is alleged to have said: > Is there any way to force a query to return just a few records? > > For ex, returning just the first ten rows from a long ORDER BY query ? > > And then, eventually, obtaining the remaining records at a later time, or > in background? > > Thanks in advance for your help, --As for the rest, it is mine. Depending on what you want, either LIMIT and OFFSET or a cursor will help you. Daniel T. Staal --------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------