Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B0E47B5DF49; Thu, 2 Jun 2011 12:02:22 -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 84967-06; Thu, 2 Jun 2011 15:02:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id A3F67B5DD7F; Thu, 2 Jun 2011 12:02:15 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id A59AE348045; Thu, 2 Jun 2011 08:02:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9grnBNowfZkM; Thu, 2 Jun 2011 08:02:12 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [190.95.16.242]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 79BFA348044; Thu, 2 Jun 2011 08:02:12 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9F9196E3F8; Thu, 2 Jun 2011 11:02:08 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: Pavel Golub , Pavel Golub , PostgreSQL Hackers , pgsql-interfaces Subject: Re: [HACKERS] PQdeleteTuple function in libpq From: Alvaro Herrera To: Andrew Chernow 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> Date: Thu, 02 Jun 2011 11:02:08 -0400 Message-Id: <1307026778-sup-415@alvh.no-ip.org> User-Agent: Sup/git 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/7 X-Sequence-Number: 6952 Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: > > 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)? Seems pretty wasteful if you want to delete a single tuple from a large result. I think if you desired to compact the result to free some memory after deleting a large fraction of the tuples in the result it could be useful to do that, otherwise just live with the unused holes in the storage area as suggested by Pavel. -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support