X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2C3B49DCB52 for ; Wed, 7 Dec 2005 02:23:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17599-04 for ; Wed, 7 Dec 2005 02:23:54 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailbox.samurai.com (mailbox.samurai.com [205.207.28.82]) by postgresql.org (Postfix) with ESMTP id 124439DCAF0 for ; Wed, 7 Dec 2005 02:23:52 -0400 (AST) Received: from localhost (mailbox.samurai.com [205.207.28.82]) by mailbox.samurai.com (Postfix) with ESMTP id BBEB22399A9; Wed, 7 Dec 2005 01:23:52 -0500 (EST) Received: from mailbox.samurai.com ([205.207.28.82]) by localhost (mailbox.samurai.com [205.207.28.82]) (amavisd-new, port 10024) with LMTP id 65751-01-4; Wed, 7 Dec 2005 01:23:51 -0500 (EST) Received: from [192.168.1.104] (d226-86-55.home.cgocable.net [24.226.86.55]) by mailbox.samurai.com (Postfix) with ESMTP id 04B2C2395CB; Wed, 7 Dec 2005 01:23:50 -0500 (EST) Subject: Re: Query Fails with error calloc - Cannot alocate memory From: Neil Conway To: Howard Oblowitz Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Date: Wed, 07 Dec 2005 01:31:37 -0500 Message-Id: <1133937097.8495.81.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com 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: 200512/222 X-Sequence-Number: 16043 On Mon, 2005-12-05 at 09:42 +0200, Howard Oblowitz wrote: > I am trying to run a query that selects 26 million rows from a > table with 68 byte rows. > > When run on the Server via psql the following error occurs: > > calloc : Cannot allocate memory That's precisely what I'd expect: the backend will process the query and begin sending back the entire result set to the client. The client will attempt to allocate a local buffer to hold the entire result set, which obviously fails in this case. You probably want to explicitly create and manipulate a cursor via DECLARE, FETCH, and the like -- Postgres will not attempt to do this automatically (for good reason). > Postgres version is 7.3.4 You should consider upgrading, 7.3 is quite old. At the very least, you should probably be using the most recent 7.3.x release, 7.3.11. -Neil