From: Tom Lane <tgl@sss.pgh.pa.us>
To: Igor Shevchenko <igor@carcass.ath.cx>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpq: how to get a sequence of partial PGresult-s
Date: Tue, 23 Sep 2003 18:27:29 -0400
Message-ID: <23995.1064356049@sss.pgh.pa.us> (raw)
In-Reply-To: <200309240109.17024.igor@carcass.ath.cx>
References: <200309240109.17024.igor@carcass.ath.cx>
Igor Shevchenko <igor@carcass.ath.cx> writes:
> Is there any way to get/process this partial PGresult in my
> app ? I haven't found any API function for this, so I thought about an
> additional function for the libpq's API -
> PGresult* PQgetNextResult ( PGconn* conn );
I think this is a really bad idea, because it destroys libpq's basic
concept that you get either success or failure for a command. Peeking
at a partially-arrived result might give you back some rows only to get
an error later (since the backend may fail partway through a query).
I'm not sure that the partially constructed result is valid anyway;
the last row may be in a funny state. And what happens if the
application does a PQclear() on it??
regards, tom lane
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: tgl@sss.pgh.pa.us, igor@carcass.ath.cx
Subject: Re: libpq: how to get a sequence of partial PGresult-s
In-Reply-To: <23995.1064356049@sss.pgh.pa.us>
* 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