Re: Obtaining a limited number of records from a long query

From: "Oliveiros Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>
To: "Ivan Sergio Borgonovo" <mail(at)webthatworks(dot)it>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Obtaining a limited number of records from a long query
Date: 2009-05-25 14:20:57
Message-ID: 027f01c9dd44$054655e0$ec5a3d0a@marktestcr.marktest.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

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" <mail(at)webthatworks(dot)it>
To: <pgsql-sql(at)postgresql(dot)org>
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" <oliveiros(dot)cristina(at)marktest(dot)pt> 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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Edward Vanden Berghe 2009-05-25 14:51:39 Re: Tool for modeling
Previous Message Daniel Staal 2009-05-25 14:15:50 Re: Obtaining a limited number of records from a long query

Browse pgsql-sql by date

  From Date Subject
Next Message Ivan Sergio Borgonovo 2009-05-25 14:56:17 Re: Obtaining a limited number of records from a long query
Previous Message Daniel Staal 2009-05-25 14:15:50 Re: Obtaining a limited number of records from a long query