Re: Comparing two PostgreSQL databases -- order of pg_dump output

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Comparing two PostgreSQL databases -- order of pg_dump output
Date: 2011-08-31 02:08:14
Message-ID: e178e2fadfbf9ffc91a5d21cf809dfec@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)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-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-08-31 06:14:55 casting between range types
Previous Message Andrew Dunstan 2011-08-31 02:07:27 Re: compile from git repository