--STEP 1 createdb.exe -E UTF8 -O postgres -h localhost -p 5440 -U postgres "55555" --STEP 2 CREATE TABLE test( id int8, inh_level int8, description varchar(100) ) without oids; CREATE TABLE test_otw(PRIMARY KEY (id)) inherits (test); ALTER TABLE test ADD PRIMARY KEY(id, inh_level); ALTER TABLE only test ALTER COLUMN inh_level SET DEFAULT 0; ALTER TABLE only test_otw ALTER COLUMN inh_level SET DEFAULT NULL; INSERT INTO test(id, description) VALUES (1, 'some test row'); INSERT INTO test_otw(id, description) VALUES (1, 'some test row'); --STEP 3 pg_dump.exe --host localhost --port 5440 --username "postgres" --format custom --blobs --inserts --column-inserts --verbose --file "reload.backup" "55" --STEP 4 dropdb.exe -h localhost -p 5440 -U postgres "66" --STEP 5 createdb.exe -E UTF8 -O postgres -h localhost -p 5440 -U postgres "66" --STEP 6 pg_restore.exe -h localhost -p 5440 -U postgres -d "66" -v "reload.backup" --STEP 7 --RESULTS AFTER RESTORE /* 55=# select * from only test; id | inh_level | description ----+-----------+--------------- 1 | 0 | some test row 55=# select * from only test_otw; id | inh_level | description ----+-----------+--------------- 1 | | some test row 66=# select * from only test; id | inh_level | description ----+-----------+--------------- 1 | 0 | some test row 66=# select * from only test_otw; id | inh_level | description ----+-----------+------------- */