Problem with dump/restore and inheritance - Mailing list pgsql-bugs

From Chris Dunlop
Subject Problem with dump/restore and inheritance
Date
Msg-id 20060222074400.GA11565@onthe.net.au
Whole thread Raw
Responses Re: Problem with dump/restore and inheritance
List pgsql-bugs
G'day all,

PG version: 8.1.0  (also 7.4.9)
OS: Linux (debian/testing)

Restoring a database with inherited tables can result in an
incorrect schema (and therefore inability to restore data).

E.g. using the script below, the 'bar.f1' column in the 'new'
database ends up with a 'not null' constraint that isn't present
in the 'orig' database.

Cheers,

Chris.

----------------------------------------------------------------------
#!/bin/sh
createdb orig
createdb new
psql orig <<END
  create table foo (f1 integer not null);
  create table bar () inherits(foo);
  alter table bar alter column f1 drop not null;
END
pg_dump orig | psql new
----------------------------------------------------------------------

pgsql-bugs by date:

Previous
From: "Ramzi M. Zeid"
Date:
Subject: Pg-restore
Next
From: "Tomasz Kliczak"
Date:
Subject: BUG #2278: problem with grants