Bug report #53 - Mailing list pgsql-bugs

From rob
Subject Bug report #53
Date
Msg-id 003701c04019$b07b3b00$4100fd0a@cabrion.org
Whole thread Raw
List pgsql-bugs
I am confirming this bug, though it appears that the order of creation is
not the issue.  If you split the dump files into schema statements and copy
data statements and run them sequentially as two different jobs everything
works just fine.

The issue appears to be that create sequence (maybe create table) statements
aren't getting "committed" in a timely manner (i.e. before the copy starts).

Here is a copy of #53's description:


 dumping a table then reloading it on a new database fails if there are
sequences involved because the sequence isn't created before the copy. After
the copy, the sequence's value isn't updated.


Here is the perl code I use to split the restores:

die 'supply dump file as first param' if not $ARGV[0];
open IN, "<$ARGV[0]";
open OUT, ">$ARGV[0].schema.sql";
open OUT2, ">$ARGV[0].data.sql";

$junk = <IN>;# drop first line with user/pass stuff;
while (<IN>) {
        $flag = 1 if /^COPY/;
        if ($flag) {
                print OUT2;
        } else {
                print OUT;
        }
};



Hope this helps isolate the issue.

--rob

pgsql-bugs by date:

Previous
From: Lamar Owen
Date:
Subject: Re: \df causes an ERROR: Function oid8types(oidvector) does not exists
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Can not use NULL values at all