Обсуждение: DDL diff utility?

Поиск
Список
Период
Сортировка

DDL diff utility?

От
Steve Manes
Дата:
My company offers an ASP service for advertising companies using PG.
For contractual reasons, each client gets its own replicated database.
This presents a problem whenever a new feature/fix requires a DDL change
which must be rolled out across N databases. Currently, we keep track of
these changes via a central text file in CVS with manually entered DDL
updates.  The problem is making sure that overworked developers actually
log all these changes.

What would be better is a DDL 'diff' utility that would look at a master
and target database and generate the necessary ALTER statements needed
to make the target db look like the master.

Is anyone aware of such a tool for PG?  I've only found it for MSSQL.

---------------------------------------------=o&o>---------
Steve Manes          http://www.magpie.com
Brooklyn, NY




Re: DDL diff utility?

От
Greg Stark
Дата:

Steve Manes <smanes@magpie.com> writes:

...
> The problem is making sure that overworked developers actually log all these
> changes.
>
> What would be better is a DDL 'diff' utility that would look at a master and
> target database and generate the necessary ALTER statements needed to make the
> target db look like the master.

You might want to look for a perl tool called "Alzabo" I don't know which
databases it supports though.

I've found it useful to do regularly run a command like:
     pg_dump -s | grep -v '^-- TOC entry' > $@

and save the result in CVS. Then I can use cvs diff to view the changes in the
schema from one checkin to another. However this just shows what the net
differences are, not what the ALTER command would be to reproduce the change.



--
greg

Re: DDL diff utility?

От
Robert Treat
Дата:
On Fri, 2003-09-19 at 07:42, Steve Manes wrote:
> My company offers an ASP service for advertising companies using PG.
> For contractual reasons, each client gets its own replicated database.
> This presents a problem whenever a new feature/fix requires a DDL change
> which must be rolled out across N databases. Currently, we keep track of
> these changes via a central text file in CVS with manually entered DDL
> updates.  The problem is making sure that overworked developers actually
> log all these changes.
>
> What would be better is a DDL 'diff' utility that would look at a master
> and target database and generate the necessary ALTER statements needed
> to make the target db look like the master.
>
> Is anyone aware of such a tool for PG?  I've only found it for MSSQL.
>

Check the mailing list archives, IIRC there is a project on sourceforge
that does this. It's a little weird though, I think it was written in
tcl and required a running webserver to make connections. HTH,

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL