Re: Query Failed, out of memory

From: "Mark Woodward" <pgsql(at)mohawksoft(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Query Failed, out of memory
Date: 2006-10-05 16:12:56
Message-ID: 18166.24.91.171.78.1160064776.squirrel@mail.mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> "Mark Woodward" <pgsql(at)mohawksoft(dot)com> writes:
>> psql -p 5435 -U pgsql -t -A -c "select client, item, rating, day from
>> ratings order by client" netflix > netflix.txt
>
>> My question, it looks like the kernel killed psql, and not postmaster.
>
> Not too surprising.
>
>> Question, is this a bug in psql?
>
> It's really a libpq design issue: since libpq provides random access to
> a PGresult, and has no mechanism for handling failures after returning
> the PGresult to the client, it has to slurp the whole query result into
> memory first.
>
> FWIW, there's a feature in CVS HEAD to instruct psql to try to use a
> cursor to break up huge query results like this. For the moment I'd
> suggest using COPY instead.

That's sort of what I was afraid off. I am trying to get 100 million
records into a text file in a specific order.

Sigh, I have to write a quick program to use a cursor. :-(

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Woodward 2006-10-05 16:15:09 Re: Query Failed, out of memory
Previous Message Tom Lane 2006-10-05 16:01:24 Re: Query Failed, out of memory