Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
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
PGP Key: 0x14964AC8 201108302203


In response to

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group