Re: BUG #5344: pg_restore some foreign keys missing - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #5344: pg_restore some foreign keys missing
Date
Msg-id 603c8f071002231955m463ca23bm1f98192ed8086099@mail.gmail.com
Whole thread Raw
In response to BUG #5344: pg_restore some foreign keys missing  ("Simon Ng" <simon94086@yahoo.com>)
List pgsql-bugs
On Tue, Feb 23, 2010 at 5:43 PM, Simon Ng <simon94086@yahoo.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =A0 =A0 =A05344
> Logged by: =A0 =A0 =A0 =A0 =A0Simon Ng
> Email address: =A0 =A0 =A0simon94086@yahoo.com
> PostgreSQL version: 8.1.11
> Operating system: =A0 RedHat Linux
> Description: =A0 =A0 =A0 =A0pg_restore some foreign keys missing
> Details:
>
> from server1 with Postgres 8.1.11 on RedHat Linux
> pg_dump -C -f db1.tar.gz -F c -Z5 -U postgres db1
>
>
> copy db1.tar.gz over to server2 with Postgres 8.1.11 on RedHat Linux
> drop database db1;
> pg_restore -C -d template1 -h localhost -U postgres db1.tar.gz
> the database of db1 is restored but the schema is incomplete. =A0Some tab=
les
> have the proper foreign keys but some tables don't.
>
> copy the same db1.tar.gz from server1 to a Win XP machine with Postgres 8=
.4
> drop database db1;
> pg_restore =A0-C -d template1 -h localhost -U postgres db1.tar.gz
> Those tables that have missing foreign keys in server2 do have the proper
> foreign
> keys defined.
>
> server1 and server2 have the same version of OS and same version of
> Postgres.
> Why are some foreign keys missing during the restore?

My guess is that the creation of those foreign key constraints failed
for some reason while restoring the dump.  Check the output of
pg_restore and see if there are any errors there.

...Robert

pgsql-bugs by date:

Previous
From: Josh Berkus
Date:
Subject: Re: RETURNS TABLE returns NULL set when called by another RETURNS TABLE
Next
From: Pavel Stehule
Date:
Subject: Re: RETURNS TABLE returns NULL set when called by another RETURNS TABLE