pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: m.vanklink@vision-development.nl
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7761: Out of memory when running pg_dump
Date: Thu, 20 Dec 2012 17:32:32 -0500
Message-ID: <25789.1356042752@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TlaBA-0004EK-03@wrigleys.postgresql.org>
References: <E1TlaBA-0004EK-03@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

m.vanklink@vision-development.nl writes:
> When running pg_dump it crashes with the following output:

> pg_dump: dumping contents of table crm_department
> pg_dump: dumping contents of table crm_department_article
> pg_dump: dumping contents of table crm_department_extra_info
> pg_dump: dumping contents of table crm_department_output
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR:  out of memory
> DETAIL:  Failed on request of size 536870912.

That doesn't look like a crash, it looks like out-of-memory.

> We don't think this is corruption of data because when running the same COPY
> command from pgAdmin it also crashes with the same error. But when adding
> WITH BINARY to this command it runs okay. This table contains extremely wide
> columns, around 130 megabytes.

There is a limit to the size of column you can manipulate without
running out of memory, and it is context-dependent, so this behavior is
neither surprising nor a bug.  The reason COPY is failing while COPY
BINARY doesn't is that the former requires multiple transient copies
of data during I/O conversion, output line formatting, etc.  At a couple
hundred megabytes apiece that'll add up pretty quickly.

If you don't want to reconsider your data storage layout, a possible
solution is to move to a 64-bit build of Postgres, so that you're not up
against a 4GB total address space limit.  (I'm not sure that 8.4.x
supports 64-bit Windows, but you could definitely get such a build in
more recent PG versions.)  Pending such a fix, you might be able to make
more space available for COPY workspace by reducing shared_buffers and
other settings that control consumption of shared memory space.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <25789.1356042752@sss.pgh.pa.us>
Permalink:  ../25789.1356042752@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25789.1356042752@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, m.vanklink@vision-development.nl
  Subject: Re: BUG #7761: Out of memory when running pg_dump
  In-Reply-To: <25789.1356042752@sss.pgh.pa.us>
  References: <E1TlaBA-0004EK-03@wrigleys.postgresql.org> <25789.1356042752@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox