X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2DB91D1B510 for ; Tue, 23 Sep 2003 22:27:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 57546-04 for ; Tue, 23 Sep 2003 19:27:31 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 29601D1B89A for ; Tue, 23 Sep 2003 19:27:28 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8NMRTiP023996; Tue, 23 Sep 2003 18:27:29 -0400 (EDT) To: Igor Shevchenko Cc: pgsql-interfaces@postgresql.org Subject: Re: libpq: how to get a sequence of partial PGresult-s In-reply-to: <200309240109.17024.igor@carcass.ath.cx> References: <200309240109.17024.igor@carcass.ath.cx> Comments: In-reply-to Igor Shevchenko message dated "Wed, 24 Sep 2003 01:09:17 +0300" Date: Tue, 23 Sep 2003 18:27:29 -0400 Message-ID: <23995.1064356049@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/62 X-Sequence-Number: 4480 Igor Shevchenko 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