Re: select * and save into a text file failed

From: "Lee Wu" <Lwu(at)mxlogic(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: select * and save into a text file failed
Date: 2005-06-10 17:05:31
Message-ID: E1F0E4D89D8FA44789DFC065C8E755281A360F@mxlhq-exch01.corp.mxlogic.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Which memory are you refer Tom?
shared_buffers= 32768
and RAM is 4G while the table is about 2G.

Why straight "select * from" need so big memory?
>From top, I did not see the process eating a lot of memory.
>From vmstat, I did not see any swaping.

It is a dedicate test box, with only PG running.

Thanks Tom,

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Friday, June 10, 2005 10:55 AM
To: Lee Wu
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] select * and save into a text file failed

"Lee Wu" <Lwu(at)mxlogic(dot)com> writes:
> My_db=3D# select * from a_table;
> Killed

Apparently the table is bigger than psql can hold in memory?

The simplest way to do this is certainly to use pg_dump in one-table
mode. If you're intent on using psql, you could use a cursor or
OFFSET/LIMIT to fetch part of the table at a time.

regards, tom lane

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2005-06-10 17:15:51 Re: select * and save into a text file failed
Previous Message Lee Wu 2005-06-10 17:03:56 Re: select * and save into a text file failed