Thread: How to compare the schemas ?
Hi everyone, I am looking for the best way to compare the schemas of two databases with the very similar structure. One (certainly not the best options) is to do something like this: pg_dump ... DB1 > PG_SCHEMA1 pg_dump ... DB2 > PG_SCHEMA2 diff PG_SCHEMA1 PG_SCHEMA2 > differences.txt kwrite differences.txt Any suggestions or ideas on how to overcome this are welcome. Thanks in advance, Milorad Poluga HK CORES Beograd, Makenzijeva 31 milorad.poluga@cores.co.yu
Hi, ----- Original Message ----- From: "Milorad Poluga" <milorad.poluga@cores.co.yu> To: <pgsql-general@postgresql.org> Sent: Wednesday, June 22, 2005 1:36 PM Subject: [GENERAL] How to compare the schemas ? >Hi everyone, > >I am looking for the best way to compare the schemas of two databases with the very similar structure. >One (certainly not the best options) is to do something like this: > >pg_dump ... DB1 > PG_SCHEMA1 >pg_dump ... DB2 > PG_SCHEMA2 >diff PG_SCHEMA1 PG_SCHEMA2 > differences.txt One way is using DBTools Manager (Windows application) to compare the database. There is a wizard for this purpose which you can use to compare the entire database and generate the SQL/DDL statements to update the target database. After the wizard finishes it generates a tree of the changes which can show you all the objects that will be updated. PS: Although there is a free version of DBTools Manager, the Compare Wizard is only available in the commercial edition. Crercio
See also the recent thread 'Version Control?' for some tools and a discussion of some of the difficulties in doing this robustly. Milorad Poluga wrote: > Hi everyone, > > I am looking for the best way to compare the schemas of two databases with the very similar structure. > One (certainly not the best options) is to do something like this: > > pg_dump ... DB1 > PG_SCHEMA1 > pg_dump ... DB2 > PG_SCHEMA2 > diff PG_SCHEMA1 PG_SCHEMA2 > differences.txt > > kwrite differences.txt > > Any suggestions or ideas on how to overcome this are welcome. > > Thanks in advance, > > Milorad Poluga > HK CORES Beograd, Makenzijeva 31 > milorad.poluga@cores.co.yu > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Peter Fein pfein@pobox.com 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman
I paid $69 and purchased the EMS PostgreSQL DB Comparer tool. Works great for me...... They have a trial version you can play with... They even have a command line version...... http://www.sqlmanager.net/en/products/postgresql/dbcomparer Peter Fein wrote: >See also the recent thread 'Version Control?' for some tools and a >discussion of some of the difficulties in doing this robustly. > >Milorad Poluga wrote: > > >>Hi everyone, >> >>I am looking for the best way to compare the schemas of two databases with the very similar structure. >>One (certainly not the best options) is to do something like this: >> >>pg_dump ... DB1 > PG_SCHEMA1 >>pg_dump ... DB2 > PG_SCHEMA2 >>diff PG_SCHEMA1 PG_SCHEMA2 > differences.txt >> >>kwrite differences.txt >> >>Any suggestions or ideas on how to overcome this are welcome. >> >>Thanks in advance, >> >>Milorad Poluga >>HK CORES Beograd, Makenzijeva 31 >>milorad.poluga@cores.co.yu >> >> >>---------------------------(end of broadcast)--------------------------- >>TIP 3: if posting/reading through Usenet, please send an appropriate >> subscribe-nomail command to majordomo@postgresql.org so that your >> message can get through to the mailing list cleanly >> >> > > > >
DB Comparer tool seems very useful. Thank you for your suggestions and links. Milorad Poluga HK CORES Beograd, Makenzijeva 31 milorad.poluga@cores.co.yu +381-11-30-80-461