Skip site navigation (1) Skip section navigation (2)

Re: Schema Upgrade Howto

From: David Fetter <david(at)fetter(dot)org>
To: Thomas Guettler <hv(at)tbz-pariv(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Schema Upgrade Howto
Date: 2008-10-30 14:02:45
Message-ID: 20081030140245.GP18097@fetter.org (view raw or flat)
Thread:
Lists: pgsql-general
On Thu, Oct 30, 2008 at 02:37:43PM +0100, Thomas Guettler wrote:
> Hi,
> 
> I found a way to do it.

It's the wrong way.  Trust me on this.

> One problem remains: The order of the columns can't be changed.  Any
> change to make postgres support this in the future?

It's been proposed several times :)

> My way:
> 
> pg_dump -s prod  | strip-schema-dump.py - > prod.schema
> pg_dump -s devel | strip-schema-dump.py - > devel.schema
> 
> strip-schema-dump.py removes some stuff which I don't care about (Owner, Comments, ...)
> 
> kdiff3 prod.schema devel.schema
> 
> You need to create an upgrade script by looking at the diff. 

No.  Really, no.  You need to create the upgrade script by creating
upgrade scripts, not by reverse engineering.

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

pgsql-general by date

Next:From: David FetterDate: 2008-10-30 14:04:17
Subject: Re: excluding tables from VACUUM ANALYZE
Previous:From: Nikolas EverettDate: 2008-10-30 13:40:59
Subject: Re: excluding tables from VACUUM ANALYZE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group