Re: pg_restore failing with "ERROR: out of memory" - Mailing list pgsql-admin

From Tom Lane
Subject Re: pg_restore failing with "ERROR: out of memory"
Date
Msg-id 17408.1205953599@sss.pgh.pa.us
Whole thread Raw
In response to pg_restore failing with "ERROR: out of memory"  (Aaron Brown <abrown@bzzagent.com>)
Responses Re: pg_restore failing with "ERROR: out of memory"  (Aaron Brown <abrown@bzzagent.com>)
List pgsql-admin
Aaron Brown <abrown@bzzagent.com> writes:
> I�m attempting to do something that should be a trivially simple task.  I
> want to do a data only dump from my production data in the public schema and
> restore it on another machine.

Does it really need to be data-only?  A regular schema+data dump usually
restores a lot faster.

Your immediate problem is probably that it's running out of memory for
pending foreign-key triggers.  Even if it didn't run out of memory, the
ensuing one-tuple-at-a-time checks would take forever.  You'd be better
off dropping the FK constraint, loading the data, and re-creating the
constraint.

There's further discussion of bulk-loading tricks in the manual:
http://www.postgresql.org/docs/8.2/static/populate.html

            regards, tom lane

pgsql-admin by date:

Previous
From: "Campbell, Lance"
Date:
Subject: Re: Windows 64 bit
Next
From: Aaron Brown
Date:
Subject: Re: pg_restore failing with "ERROR: out of memory"