Re: Version Control Software for Database Objects

From: Tim Allen <tim(at)proximity(dot)com(dot)au>
To: Mark Dexter <MDEXTER(at)dexterchaney(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Version Control Software for Database Objects
Date: 2005-01-14 02:06:58
Message-ID: 41E72942.9060807@proximity.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mark Dexter wrote:
> We maintain multiple versions of our application's database and we are
> looking for version control software to help us automate this.
> Specifically, we would like to have a program that automatically tracks
> all changes to the database (tables, views, functions, etc.) and assists
> with updating customers' databases from one version to the next.
>
> Does anyone know of such a program that works with PostgreSQL? Thanks
> for your help.

Assuming you mean version control of the _schema_, rather than the data
therein, then no, I don't know of any such program available. However,
it's not too hard to do it yourself, which is what we've done. Create a
table which has only one row, containing a schema version number, and
build some constant into your application which has the same number -
the application should check the database schema number on startup and
complain loudly if the two don't match. Every time you release a new
version of the application that has a schema change, then both increment
the schema number and write a script that will perform the schema update
from version n to version n + 1. If you name your scripts in a
consistent way, it's not hard to then write a script that compares the
current schema version at a site with that expected by the new
application version, and incrementally runs each update script.

Tim

--
-----------------------------------------------
Tim Allen tim(at)proximity(dot)com(dot)au
Proximity Pty Ltd http://www.proximity.com.au/
http://www4.tpg.com.au/users/rita_tim/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2005-01-14 04:34:29 Re: best place to enfore rules
Previous Message Jeff Davis 2005-01-14 01:45:05 Re: Version Control Software for Database Objects