X-Original-To: pgsql-admin@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 990F8923494 for ; Fri, 23 May 2003 11:50:22 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 73451-02 for ; Fri, 23 May 2003 11:50:05 -0400 (EDT) Received: from smaug.securitymatrix.com (unknown [64.25.5.177]) by developer.postgresql.org (Postfix) with ESMTP id 703F0924D73 for ; Fri, 23 May 2003 11:21:49 -0400 (EDT) Received: from kaos.securitymatrix.com ([172.16.0.101]) by smaug.securitymatrix.com (8.11.6/8.11.6) with ESMTP id h4NFLNV17430 for ; Fri, 23 May 2003 11:21:24 -0400 Subject: Database Backup/Restore with Inherited Tables From: Dawn Hollingsworth To: pgsql-admin@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 23 May 2003 03:20:43 +0000 Message-Id: <1053660043.1929.47.camel@kaos> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/332 X-Sequence-Number: 8894 Postgres 7.2.3 The application I am working had a database schema utilizing table inheritance. As the application changes so does our schema and recently modifications where made to these tables. For existing customers I generally write an upgrade script to migrate the schema. In this case it only involved adding a few new columns to the base table. Customers are provided utilities to backup and restore their database as they see fit. The problem arose when this migrated database was backed up and restored. When the base table was altered the new columns were added to the end of the inherited table automatically( base table columns, inherited table additional columns, new base table columns). But if you backup and restore the schema changes to base table, new base table columns then inherited table additional columns. Unfortunately the data is in the other order. I've pulled apart the pg_dump file and I understand what is happening I would like any suggestions on how to migrate my schema so the backup/restore will work. Dawn