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

Re: Schema Upgrade Howto

From: Thomas Guettler <hv(at)tbz-pariv(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Schema Upgrade Howto
Date: 2008-10-30 13:37:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general

I found a way to do it. One problem remains: The order of the columns
can't be changed.
Any change to make postgres support this in the future?

My way:

pg_dump -s prod  | - > prod.schema
pg_dump -s devel | - > devel.schema 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. 
But it is not difficult:

-- update-YYYY-MM-DD.sql
alter table ... add column ...;

Execute on production:
cat update-YYYY-MM-DD.sql | psql 


David Fetter schrieb:
> On Thu, Oct 30, 2008 at 10:54:46AM +0100, Thomas Guettler wrote:
>> Hi,
>> is there a schema upgrade howto? I could not find much with google.
>> There is a running DB and a development DB. The development DB
>> has some tables, columns and indexes added.
> The only sure way to track such changes is by changing the
> databases--especially in development--only via scripts, all of which
> go into your source code management system.

Thomas Guettler,
E-Mail: guettli (*) thomas-guettler + de

In response to


pgsql-general by date

Next:From: Nikolas EverettDate: 2008-10-30 13:40:59
Subject: Re: excluding tables from VACUUM ANALYZE
Previous:From: Teodor SigaevDate: 2008-10-30 13:37:40
Subject: Re: Weird problem concerning tsearch functions built into postgres 8.3, assistance requested

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