Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3B607B5DF49; Thu, 2 Jun 2011 11:32:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 97471-05; Thu, 2 Jun 2011 14:32:20 +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-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id D700CB606AC; Thu, 2 Jun 2011 11:32:19 -0300 (ADT) Received: by fxm17 with SMTP id 17so734323fxm.19 for ; Thu, 02 Jun 2011 07:32:19 -0700 (PDT) Received: by 10.223.27.195 with SMTP id j3mr904709fac.83.1307025139706; Thu, 02 Jun 2011 07:32:19 -0700 (PDT) Received: from [192.168.1.104] (161-32-133-95.pool.ukrtel.net [95.133.32.161]) by mx.google.com with ESMTPS id h1sm200190fag.11.2011.06.02.07.32.18 (version=SSLv3 cipher=OTHER); Thu, 02 Jun 2011 07:32:18 -0700 (PDT) Date: Thu, 2 Jun 2011 17:32:15 +0300 From: Pavel Golub Reply-To: Pavel Golub Organization: Microolap X-Priority: 3 (Normal) Message-ID: <11417115.20110602173215@gf.microolap.com> To: Andrew Chernow CC: Pavel Golub , PostgreSQL Hackers , Subject: Re: [HACKERS] PQdeleteTuple function in libpq In-Reply-To: <4DE79A58.4010608@esilo.com> References: <147534417.20110601184310@gf.microolap.com> <4DE6A5B7.2070700@esilo.com> <707574086.20110602112826@gf.microolap.com> <4DE79A58.4010608@esilo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/6 X-Sequence-Number: 6951 Hello, Andrew. You wrote: AC> On 6/2/2011 4:28 AM, Pavel Golub wrote: >> Hello, Andrew. >> >> You wrote: >> >> AC> On 6/1/2011 11:43 AM, Pavel Golub wrote: >>>> Hello. >>>> >>>> I'm some kind of PQdeleteTuple function will be very usefull in libpq. >>>> Because right now after deleting some record I need refetch result >>>> set, or mark tuple as deleted and this is headache for me. >>>> >> >> 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. >> AC> I'm not entirely sure what you are trying to do, but can't you use AC> PQmakeEmptyPGresult, PQsetResultAttrs and PQsetvalue to construct a AC> result that excludes the tuples you don't want followed by a AC> PQclear(initial_result)? Well, yes. I can. But don't you think it's too complex? Plus such approach uses twice as much memory. -- With best wishes, Pavel mailto:pavel@gf.microolap.com