Re: select * and save into a text file failed - Mailing list pgsql-admin

From Lee Wu
Subject Re: select * and save into a text file failed
Date
Msg-id E1F0E4D89D8FA44789DFC065C8E755281A360E@mxlhq-exch01.corp.mxlogic.com
Whole thread Raw
In response to select * and save into a text file failed  ("Lee Wu" <Lwu@mxlogic.com>)
Responses Re: select * and save into a text file failed  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: select * and save into a text file failed  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-admin
That is exactly what I did:

\o a_lot_room_to_hold_my_result
select * from a_table

either
1. out of memory for query result
2. killed
3. crash PG

"If you have a very large table you can exhaust memory on the client
side unless you are writing the data directly to a file."
How besides "\o" and pg_dump?

We have 4G RAM, and shared_buffers= 32768, it is a dedicate test box,
while the table is about 2G.

Thanks,

-----Original Message-----
From: Steve Crawford [mailto:scrawford@pinpointresearch.com]
Sent: Friday, June 10, 2005 11:00 AM
To: Lee Wu; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] select * and save into a text file failed

On Friday 10 June 2005 9:33 am, Lee Wu wrote:
> Even without saving to file, it is still killed:
>...
> My_db=# select * from a_table;
> Killed
>...

The previous examples don't work for me. In psql try this:
--First set the output to a file
\o 'my_output.txt'

--Now run the query
select * from myfile;

--Quit and check your results
\q

If you have a very large table you can exhaust memory on the client
side unless you are writing the data directly to a file.

Cheers,
Steve


pgsql-admin by date:

Previous
From: Steve Crawford
Date:
Subject: Re: select * and save into a text file failed
Next
From: "Lee Wu"
Date:
Subject: Re: select * and save into a text file failed