X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 65CF4D8960 for ; Wed, 9 Nov 2005 18:09:19 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10981-09 for ; Wed, 9 Nov 2005 22:09:15 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from calvin.slamb.org (calvin.slamb.org [216.136.66.56]) by svr1.postgresql.org (Postfix) with ESMTP id A5EBFD71E0 for ; Wed, 9 Nov 2005 18:09:16 -0400 (AST) Received: by calvin.slamb.org (Postfix, from userid 103) id 813516FD2C; Wed, 9 Nov 2005 16:09:18 -0600 (CST) Received: from [IPv6:::1] (localhost.slamb.org [127.0.0.1]) by calvin.slamb.org (Postfix) with ESMTP id 2852E6FD27; Wed, 9 Nov 2005 16:09:17 -0600 (CST) In-Reply-To: <19391.1131571328@sss.pgh.pa.us> References: <4D426B54-E08F-4DE9-9776-D46610CA4968@slamb.org> <19391.1131571328@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <84C7635D-EAF2-40CF-A71C-976077D5465A@slamb.org> Cc: pgsql-interfaces@postgresql.org Content-Transfer-Encoding: 7bit From: Scott Lamb Subject: Re: Incremental results from libpq Date: Wed, 9 Nov 2005 14:09:09 -0800 To: Tom Lane X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/13 X-Sequence-Number: 5809 On Nov 9, 2005, at 1:22 PM, Tom Lane wrote: > Scott Lamb writes: >> Is there a better way? > > Not at the moment. It's been requested before though, so if you > want to > develop a patch for libpq, have at it. > > The main reason why libpq does what it does is that this way we do not > have to expose in the API the notion of a command that fails part way > through. If you support partial result fetching then you'll have to > deal with the idea that a SELECT could fail after you've already > returned some rows to the client. I am not sure that this is a huge > deal, but it definitely uglifies the API a bit. It would be a good > idea to think through exactly what clients will need to do to cope > with > that fact before you start designing the API extension. Cool. I think I'll get my own interface hashed out in my kludgey way, then look at the broader need if it's a success. My first idea, though, is to add a callback interface - "got the RowDescription", "got a DataRow" - and make the storage of stuff tuples in PGresult optional. (Maybe pqAddTuple would just be the default callback.) Regards, Scott -- Scott Lamb