X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 56612D1E5F1 for ; Thu, 29 Apr 2004 16:50:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48104-04 for ; Thu, 29 Apr 2004 16:50:18 -0300 (ADT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id CFC56D1E7D4 for ; Thu, 29 Apr 2004 16:50:15 -0300 (ADT) Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BJHY0-0003gE-00 for ; Thu, 29 Apr 2004 21:50:16 +0200 Received: from corp-fw-main.jabber.com ([207.182.164.14]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Apr 2004 21:50:16 +0200 Received: from bgilson by corp-fw-main.jabber.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Apr 2004 21:50:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-interfaces@postgresql.org From: Bob Gilson Subject: Re: cursor interface to libpq limited by virtual memory Date: Thu, 29 Apr 2004 12:12:04 -0600 Lines: 28 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: corp-fw-main.jabber.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040311 X-Accept-Language: en-us, en X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/13 X-Sequence-Number: 4905 Below is a post from 2000. It describes a limitation processing large selects with libpq. Does this limitation still exist? Thanks in advance, Bob Gilson Kirby Bohling wrote: >>I am trying to run a select statement, and I keep running out of >>memory. After a little investigate, I found >>that libpq appears to get the entire result set at once. The bottleneck here is mainly that libpq's API is defined in terms of providing random access to a result set, no matter how large --- so libpq has to buffer the whole result set in client memory. Aside from random access there are also error-reporting issues. Currently libpq guarantees to tell you about any errors encountered during a query before you start to read result rows. That guarantee wouldn't hold in a streaming-results scenario. These issues have been discussed quite a few times before --- see the pg-interfaces archives. I think everyone agrees that it'd be a good idea to have a streamable libpq interface, but no one's stepped up to the plate to define or implement one... regards, tom lane