I have had trouble on numerous occasions "undumping" a pg_dump.  Below is 
a perl script that I use as a pipe for undumping...hope it helps

.....pg_undump.....
#!/usr/bin/perl -p

# This script is a pipe that is used to break up PSQL dumps into pieces
# that are more manageable by the postmaster.  If there are too many
# input lines, the memory used by the transaction block can easily
# choke the machine.

BEGIN { $MAXLINES = 1000; }

# Does the current input line define the beginning of an input block?
if (m/^COPY/) {
    # When a copy line is encountered grab the line for later use
    # and turn on the line counter;
    $copyline = $_;
    $cnt = 0;
}

# Does the current input line define the end of an input block?
if (m{^\\\.}) {
    # We have just macthed the end of STDIN line.  Set counter off
    undef $cnt;
}

# If we are in an input block and the count is at the max, "flush" the buffer
# and setup for the next block.
if (defined($cnt) and ($cnt > $MAXLINES) ) {
    $cnt = 0;
    print '\.', "\n";
    print $copyline;
}

$cnt++ if defined $cnt;

Reply via email to