Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 78144B5E0B6; Thu, 2 Jun 2011 11:33:09 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 87777-07; Thu, 2 Jun 2011 14:33:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.esilo.com (ns2.esilo.com [63.150.152.211]) by mail.postgresql.org (Postfix) with ESMTP id 45B6CB5DF49; Thu, 2 Jun 2011 11:33:02 -0300 (ADT) Received: from [10.0.0.2] (fwext-esilo-jupiter.esilo.com [173.162.79.161]) (authenticated bits=0) by mail.esilo.com (8.13.1/8.13.1) with ESMTP id p52EWxBl000825 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 2 Jun 2011 10:33:00 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=esilo.com; s=200912; t=1307025180; bh=n0kmMxwENRUCI0WBDJTXmBH4euU=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ccxOvW2cgSJhQVldi2fnlIO2CWU28MU53jytVpo4/ArTnSCj7/gVR9kwYCfCph+Rt bP90WCkhiNcNS7ih0TvhB711Lx7xyqShzzfbDHliqA3ZPrpm3CpbYZdn1Egr+x/CpJ AYPiN7DK4ifZIFz0tff8VMArc/JjfztLVnhv+hTg= DomainKey-Signature: a=rsa-sha1; s=main; d=esilo.com; c=simple; q=dns; b=2EVc+t/56qfi98HqH4mF278HpTZVFHepu9R0p0y7SC+MCeGTeAyjvxV9n4DvYU7Hn AdVr/doSlRatYv0cerPtg== Message-ID: <4DE79F23.3060204@esilo.com> Date: Thu, 02 Jun 2011 10:33:07 -0400 From: Andrew Chernow User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pavel Golub CC: Pavel Golub , PostgreSQL Hackers , pgsql-interfaces@postgresql.org Subject: Re: PQdeleteTuple function in libpq References: <147534417.20110601184310@gf.microolap.com> <4DE6A5B7.2070700@esilo.com> <707574086.20110602112826@gf.microolap.com> <4DE79A58.4010608@esilo.com> In-Reply-To: <4DE79A58.4010608@esilo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/124 X-Sequence-Number: 188837 >> AC> IMHO, this should be handled by the application. You could track >> tuples >> AC> removed in an int[] or copy the result set into an application >> defined >> AC> array of C structures. I've always been under the impression that >> AC> PGresult objects are immutable once delivered to the application. >> >> >> Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, >> PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course >> there's no big deal with their absence but let's be consistent. >> > > I'm not entirely sure what you are trying to do, but can't you use > PQmakeEmptyPGresult, PQsetResultAttrs and PQsetvalue to construct a > result that excludes the tuples you don't want followed by a > PQclear(initial_result)? > Actually the best solution would be to call PQcopyResult with all PG_COPYRES_XXX flags enabled except PG_COPYRES_TUPLES. Now call PQsetvalue for each tuple you want to add. -- Andrew Chernow eSilo, LLC global backup http://www.esilo.com/