Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f49Ed6A56802 for ; Wed, 9 May 2001 10:39:06 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f49EcwR20423; Wed, 9 May 2001 10:38:58 -0400 (EDT) To: Reiner Dassing cc: pgsql-admin@postgresql.org Subject: Re: Restoring a pg_dump fails with 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> Comments: In-reply-to Reiner Dassing message dated "Wed, 09 May 2001 11:43:10 +0200" Date: Wed, 09 May 2001 10:38:58 -0400 Message-ID: <20420.989419138@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200105/38 X-Sequence-Number: 1378 Reiner Dassing 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