Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5844F632323 for ; Mon, 25 May 2009 11:21:03 -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 43223-03 for ; Mon, 25 May 2009 11:20:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from jupiter.marktest.pt (delta.marktest.pt [80.251.174.116]) by mail.postgresql.org (Postfix) with ESMTP id 279D263462B for ; Mon, 25 May 2009 11:21:00 -0300 (ADT) Received: from suite (suite.marktest.pt [10.61.90.236]) by jupiter.marktest.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id K0H2PYBP; Mon, 25 May 2009 15:20:57 +0100 Message-ID: <027f01c9dd44$054655e0$ec5a3d0a@marktestcr.marktest.pt> From: "Oliveiros Cristina" To: "Ivan Sergio Borgonovo" , References: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt><4A1AA0FA.1070507@networkmail.eu><025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt> <20090525161347.166789ac@dawn.webthatworks.it> Subject: Re: Obtaining a limited number of records from a long query Date: Mon, 25 May 2009 15:20:57 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL=-0.000, STOX_REPLY_TYPE=0.001 X-Spam-Level: X-Archive-Number: 200905/108 X-Sequence-Number: 32600 Thank you for pointing it out, Ivan. The query I am trying to restrict output for happens to be an ORDER BY query. Actually I wasn't aware of this detail. I'll leave a mental note for myself that results might be unexpected for not ORDER BY queries Best, Oliveiros ----- Original Message ----- From: "Ivan Sergio Borgonovo" To: Sent: Monday, May 25, 2009 3:13 PM Subject: Re: [SQL] Obtaining a limited number of records from a long query > On Mon, 25 May 2009 14:55:54 +0100 > "Oliveiros Cristina" wrote: > >> >> >> Thanks a million, Andy. >> >> It's precisely what I needed, Indeed! > > Beware: unless you specify an ORDER BY (and you expect no other > record is inserted between one query and the other... or you just > don't care) you may incur in unexpected results. > > A query without an order by is not granted to return the result in > the same order. > > If you can (same session) you may use cursors. > > > -- > Ivan Sergio Borgonovo > http://www.webthatworks.it > > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql >