From: Neil Conway <neilc@samurai.com>
To: Howard Oblowitz <Howard.Oblowitz@lewisgroup.co.za>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query Fails with error calloc - Cannot alocate memory
Date: Wed, 07 Dec 2005 01:31:37 -0500
Message-ID: <1133937097.8495.81.camel@localhost.localdomain> (raw)
In-Reply-To: <A68494B2A51F8E45B8D16EADEE016637BABFC0@lewadmail.lewisgroup.co.za>
References: <A68494B2A51F8E45B8D16EADEE016637BABFC0@lewadmail.lewisgroup.co.za>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: neilc@samurai.com, Howard.Oblowitz@lewisgroup.co.za
Subject: Re: Query Fails with error calloc - Cannot alocate memory
In-Reply-To: <1133937097.8495.81.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox