Re: How to compare the schemas ? - Mailing list pgsql-admin

From Ian FREISLICH
Subject Re: How to compare the schemas ?
Date
Msg-id E1DnGCE-0000ps-Rv@hetzner.co.za
Whole thread Raw
In response to Re: How to compare the schemas ?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: How to compare the schemas ?  (Scott Marlowe <smarlowe@g2switchworks.com>)
Re: How to compare the schemas ?  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-admin
Peter Eisentraut wrote:
> Milorad Poluga wrote:
> > One (certainly not the best options) is to do something like this:
> >
> > pg_dump ... DB1 =A0> PG_SCHEMA1
> > pg_dump ... DB2 =A0> PG_SCHEMA2
> > diff =A0PG_SCHEMA1 =A0PG_SCHEMA2 =A0> differences.txt
>
> What is wrong with that?

All the extra TOC ID and comment stuff that pg_dump introduces.
Also, I think that the dump is sorted by creation order or some
other scheme, so even though the databases might be identical, the
diff output would be significant.

This is something that I have battled in the past.  The only solution
was to always update the database from a set of scripts, one for
each function and one for the tables.  These scripts kept in CVS
auto update the comment on each object:

COMMENT ON FUNCTION namedConfGen(TEXT,TEXT) IS '$Id: sproc.api.namedConfGen,v 1.
8 2004/05/07 08:02:55 ianf Exp $';

Now I can cvs diff using the version numbers.  Not ideal, but at
least I know exactly where I am.

Ian

--
Ian Freislich

pgsql-admin by date:

Previous
From: Chuming Chen
Date:
Subject: change existing table definition
Next
From: Peter Eisentraut
Date:
Subject: Re: change existing table definition