pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dawn Hollingsworth <dmh@airdefense.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Database Backup/Restore with Inherited Tables
Date: Fri, 23 May 2003 13:29:08 -0400
Message-ID: <17124.1053710948@sss.pgh.pa.us> (raw)
In-Reply-To: <1053660043.1929.47.camel@kaos>
References: <1053660043.1929.47.camel@kaos>

Dawn Hollingsworth <dmh@airdefense.net> writes:
> 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.

Yeah, this is a longstanding gotcha with adding columns to parent tables
:-(.  It's solved in 7.3 by explicitly specifying the column order in
each COPY command issued by pg_dump.  If you are trying to migrate to
7.3 then the solution is to use 7.3's pg_dump against the 7.2 server to
produce the dump.  If you need to transport data within 7.2 or before,
I think the only simple answer is to use pg_dump's -D option so that the
data is dumped as explicitly labeled INSERTs.  It's a lot slower but it
will work.

			regards, tom lane



view thread (2+ messages)

Message-ID: <17124.1053710948@sss.pgh.pa.us>
Permalink:  ../17124.1053710948@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17124.1053710948@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dmh@airdefense.net
  Subject: Re: Database Backup/Restore with Inherited Tables
  In-Reply-To: <17124.1053710948@sss.pgh.pa.us>
  References: <1053660043.1929.47.camel@kaos> <17124.1053710948@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox