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

Diffs between two databases...

From: Mario Splivalo <mario(dot)splivalo(at)mobart(dot)hr>
To: pgsql-admin(at)postgresql(dot)org
Subject: Diffs between two databases...
Date: 2005-11-18 13:47:26
Message-ID: 1132321646.7965.22.camel@ekim (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
I have a production server (7.4.9) with, of course, a production
database with 30 tables, 250 functions, types, views, indices, ...

My developers have created new version of the software, that includes
the new version of the datbase. They've changed 6 tables, two dozen
views and almost one hundred stored procedures. Now I need to apply
those changes on the production server.

Is there a way to generate a 'diff' script for the two databases? I'd
write script myself if I'd be able to 'script' just the desired object.
For instance, just the function.

I've seen that I can do pg_dump to a file with pg_dump -Fc, and then I
can do pg_restore -Fc -l <dump.file> to have the list of all the
database objects. There I can see the functions, but how do I (re)create
just the desired function?

What would suit me the best would be a tool/util that would drop each
db.object into a separate file. Then I could create a script wich will
'load' each object from the file when I want it (so I don't have
dependency problems).

Is there a tool like that, or should I stick with pg_dump/pg_restore, or
maybe even going trough information_schema to see all the objects in the

Mario Splivalo

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


pgsql-admin by date

Next:From: Alvaro HerreraDate: 2005-11-18 17:34:02
Subject: Re: Diffs between two databases...
Previous:From: DiegoDate: 2005-11-18 12:35:02
Subject: Version 8.1

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