pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Jan van der Weijde <Jan.van.der.Weijde@attachmate.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: How do I detect End-of-table or End-of-limit ?
Date: Thu, 11 Jan 2007 21:36:41 -0300
Message-ID: <20070112003641.GI10464@alvh.no-ip.org> (raw)
In-Reply-To: <4B9C73D1EB78FE4A81475AE8A553B3C67DC52B@exch-lei1.attachmate.com>
References: <4B9C73D1EB78FE4A81475AE8A553B3C67DC52B@exch-lei1.attachmate.com>

Jan van der Weijde wrote:

> However I am looking for something more elegant like a status flag in
> libpq that indicate EOF or End-Of-limit.

I don't think there's an actual "EOF".  What you see is an "end of
tuples in the result set".  Whether it is because you ran into the
LIMIT, or because you fell off the end of the table, you can't tell (nor
can the server actually).

Maybe it's more appropriate for you to open a cursor for the whole
table, and then do FETCH from it until it runs out of tuples; you will
know then that it's the end of the table.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



view thread (4+ messages)  latest in thread

Message-ID: <20070112003641.GI10464@alvh.no-ip.org>
Permalink:  ../20070112003641.GI10464@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070112003641.GI10464@alvh.no-ip.org

 · 

reply

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-interfaces@postgresql.org
  Cc: alvherre@commandprompt.com, Jan.van.der.Weijde@attachmate.com
  Subject: Re: How do I detect End-of-table or End-of-limit ?
  In-Reply-To: <20070112003641.GI10464@alvh.no-ip.org>

* 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