Re: Problem w/ dumping huge table and no disk space - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Problem w/ dumping huge table and no disk space
Date
Msg-id 20010908190100.B17777@svana.org
Whole thread Raw
In response to Re: Problem w/ dumping huge table and no disk space  (David Ford <david@blue-labs.org>)
List pgsql-general
On Sat, Sep 08, 2001 at 01:59:54AM -0400, David Ford wrote:
> On a side note (Tom, Bruce, etc), is there some way to mitigate psql's
> storage of all rows returned in memory?  Perhaps a 'swap' file?  If you
> connect to a 1.7G database and issue a query on it that returns a lot of
> rows, the entire thing is held in memory which with such a query is
> likely to cause an OOM and get killed.

psql does it because that's what the library does. I'm not sure if you can
get the library to return before all the rows have transferred. And if you
can someone needs to fix psql to use it.

pg_dump -d used to have this problem also but I recently submitted a patch
so that that doesn't happen anymore. I guess you could arrange for psql to
rewrite your SELECT statements to use a cursor but that may be unexpected...

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Re: Idea: jobs.postgresql.org
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Abort state on duplicated PKey in transactions