Problem with dump/restore and inheritance

From: Chris Dunlop <chris(at)onthe(dot)net(dot)au>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Problem with dump/restore and inheritance
Date: 2006-02-22 07:44:00
Message-ID: 20060222074400.GA11565@onthe.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
----------------------------------------------------------------------

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomasz Kliczak 2006-02-22 11:15:19 BUG #2278: problem with grants
Previous Message Qingqing Zhou 2006-02-22 03:17:51 FATAL: semctl(1672698088, 12, SETVAL, 0) failed