Thread: pg_diff, or something like it...?

pg_diff, or something like it...?

From
Mario Splivalo
Date:
I've found pg_diff, a ruby script, wich does the job - not quite.

The issue is like this:

I have a database on few production servers, some 40 tables with 60
views, 120 types and 250 functions. The functions are used for internal
application bussines logic, as for the interface to the application
front-end engine. Now, when 'upgrading' an application we often change
some of the tables, views, types or functions. pg_diff script can help
in tracking the differences between the current production version of
the database shema, and the new, 'upgraded' version of database shema.
The nightmare begins when actually trying to upgrade the schema. For
instance, changing a view definition (changed the number of columns)
requires me to drop that view, and all other dependant views and/or
functions. Now I'm doing it by hand, and I'm asking is there a tool wich
could help me track the differences?

The ultimate goal would be to have a .deb package for our application,
so upgrading the application would be easy as 'apt-get upgrade'.
The .deb package installation would stop the application, apply
the .diff.sql file (first drop the objects, then recreate them), and
then restart the application.

But, for now, just a 'dependency tracker' of some sort would be a huge
help.

    Mario
--
Mario Splivalo
Mob-Art
mario.splivalo@mobart.hr

"I can do it quick, I can do it cheap, I can do it well. Pick any two."