pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Reiner Dassing <dassing@wettzell.ifag.de>
Cc: pgsql-admin@postgresql.org
Subject: Re: Restoring a pg_dump fails with
Date: Wed, 09 May 2001 10:38:58 -0400
Message-ID: <20420.989419138@sss.pgh.pa.us> (raw)
In-Reply-To: <3AF9112E.8D5C4833@wettzell.ifag.de>
References: <3AE84026.F994B9E2@wettzell.ifag.de>
	<16641.988302196@sss.pgh.pa.us>
	<3AE9262E.6191263F@wettzell.ifag.de>
	<4403.988375262@sss.pgh.pa.us>
	<3AED0AC3.2198D6F9@wettzell.ifag.de>
	<14603.988639166@sss.pgh.pa.us>
	<3AF018A5.2F424492@wettzell.ifag.de>
	<11497.988815239@sss.pgh.pa.us>
	<3AF9112E.8D5C4833@wettzell.ifag.de>

Reiner Dassing <dassing@wettzell.ifag.de> writes:
> Sorry for coming up again with the same problem:
> COPY FROM fails with "Memory exhausted in AllocSetAlloc(40)"

> CREATE TABLE "wetter" (
> 	"sensor_id" int4 NOT NULL REFERENCES sensoren_an_orten,
> 	"epoche" datetime NOT NULL,
> 	"wert" float4 NOT NULL,
>         PRIMARY KEY (sensor_id,epoche));

Ah-hah, so there *is* an AFTER trigger on "wetter", namely the one that
enforces the REFERENCES check.

Probably you are running out of memory for the list of pending trigger
activations; there will be one entry in it per row inserted during the
current transaction, so I can easily believe that you might have a
problem after a couple million rows have been loaded by COPY.

We have a TO-DO item to allow the trigger list to be shoved out to disk
when it gets too long, but that's not done yet ...

I suggest you either break your data load into chunks of no more than
a million rows, or (if you are sure the incoming data is good) disable
the table's triggers during bulk load.  For an example of doing that,
look at the script that pg_dump emits for data-only backup.

			regards, tom lane



view thread (12+ messages)

Message-ID: <20420.989419138@sss.pgh.pa.us>
Permalink:  ../20420.989419138@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20420.989419138@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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dassing@wettzell.ifag.de
  Subject: Re: Restoring a pg_dump fails with
  In-Reply-To: <20420.989419138@sss.pgh.pa.us>
  References: <3AE84026.F994B9E2@wettzell.ifag.de> <16641.988302196@sss.pgh.pa.us> <3AE9262E.6191263F@wettzell.ifag.de> <4403.988375262@sss.pgh.pa.us> <3AED0AC3.2198D6F9@wettzell.ifag.de> <14603.988639166@sss.pgh.pa.us> <3AF018A5.2F424492@wettzell.ifag.de> <11497.988815239@sss.pgh.pa.us> <3AF9112E.8D5C4833@wettzell.ifag.de> <20420.989419138@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