From: Daniel Staal <DStaal@usa.net>
To: pgsql-novice@postgresql.org
Subject: Re: Obtaining a limited number of records from a long query
Date: Mon, 25 May 2009 10:15:50 -0400
Message-ID: <B887F754A90503A330C4F680@Mac-Pro.magehandbook.com> (raw)
In-Reply-To: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt>
References: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt>
--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.
<http://www.postgresql.org/docs/8.3/interactive/queries-limit.html;
<http://www.postgresql.org/docs/8.3/interactive/sql-declare.html;
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.
---------------------------------------------------------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: DStaal@usa.net, pgsql-novice@postgresql.org
Subject: Re: Obtaining a limited number of records from a long query
In-Reply-To: <B887F754A90503A330C4F680@Mac-Pro.magehandbook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox