Skip site navigation (1) Skip section navigation (2)

BUG #4698: psql.exe is exits reporting "out of memory" error

From: "Yuri Cherio" <yuri(at)aergo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4698: psql.exe is exits reporting "out of memory" error
Date: 2009-03-10 18:13:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4698
Logged by:          Yuri Cherio
Email address:      yuri(at)aergo(dot)com
PostgreSQL version: 8.3.5-2
Operating system:   Windows XP Pro, SP3
Description:        psql.exe is exits reporting "out of memory" error

I have SELECT statement result of which I need to dump into a file. Before
dumping it I do line-by-line formatting. The command line looks like this:

psql -f "filename.sql" | sed '<formatting>' > "out_file_name"

Whenever the result set is large (hundreds of thousands of rows) the command
fails and the "out_file_name" size is zero. Simplified command (see below)
has absolutely same behavior:

psql -f "filename.sql" > "out_file_name"

One would expect that standard output should not be accumulated until it
blows up but instead would behave as a stream.

I didn't try this on linux, but it is happening in Windows.

P.S. The same can be achieved with COPY command, however conceptually
speaking the problem of not streaming the result properly still exists.


pgsql-bugs by date

Next:From: Scott ReedDate: 2009-03-10 19:23:19
Subject: BUG #4699: pg_restore hangs with incorrect file format
Previous:From: Teodor SigaevDate: 2009-03-10 17:44:57
Subject: Re: BUG #4697: to_tsvector hangs on input

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group