Re: Comparing two PostgreSQL databases -- order of pg_dump output - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: Comparing two PostgreSQL databases -- order of pg_dump output
Date
Msg-id e178e2fadfbf9ffc91a5d21cf809dfec@biglumber.com
Whole thread Raw
In response to Re: Comparing two PostgreSQL databases -- order of pg_dump output  (Joe Abbate <jma@freedomcircle.com>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> Note that what I'm looking for is something to compare just about 
> EVERYTHING DDL under the PostgreSQL sun: tables, types, functions, 
> operators, etc. The description of same_schema appears to imply only a 
> subset of objects are compared (in fact, looking at the code, I can 
> confirm that limitation).

You should try the latest version in git (which will soon be released 
as 2.18.0). The same_schema check has been overhauled, and now can also 
store a copy of a databases state to allow checking the same database 
over time to see what has changed. It doesn't check *everything* yet, 
but the only things missing are some of the more obscure items such 
as custom conversions. It should be pretty easy to add in anything 
that is not already covered, even for someone not versed in Perl.

> BTW, I tried installing check_postgres, but not being much into Perl and 
> not knowing what dependencies it has, "make test" failed 38/42 tests.

That's not much to worry about. It's a pretty straightforward script, 
in that it is very easy to determine if it is working for you or not, 
even if some of the tests fail. :)

>> I'm not exactly sure how it does it

check_postgres queries the system catalogs, normalizes some things based 
on the version, and creates a Perl object representation of the database. 
It then compares that to the same thing from a different database/server, 
or to a frozen version of an earlier scan.

- -- 
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201108302203
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAk5dl28ACgkQvJuQZxSWSsidhwCeMGEx8eVeaPlyRALuh8VuQ+rN
ynYAoLDGLOFNVbj3+NnRvZpLfgmh6Mgu
=w1eI
-----END PGP SIGNATURE-----



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: compile from git repository
Next
From: Jeff Davis
Date:
Subject: casting between range types