Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlofN-0005uq-8T for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Dec 2012 22:32:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TlofM-0005An-Ir for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Dec 2012 22:32:36 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlofL-0005A7-L5 for pgsql-bugs@postgresql.org; Thu, 20 Dec 2012 22:32:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlofJ-0005XO-NT for pgsql-bugs@postgresql.org; Thu, 20 Dec 2012 22:32:35 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qBKMWWuv025790; Thu, 20 Dec 2012 17:32:32 -0500 (EST) From: Tom Lane To: m.vanklink@vision-development.nl cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7761: Out of memory when running pg_dump In-reply-to: References: Comments: In-reply-to m.vanklink@vision-development.nl message dated "Thu, 20 Dec 2012 07:04:28 +0000" Date: Thu, 20 Dec 2012 17:32:32 -0500 Message-ID: <25789.1356042752@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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