pgdiff compares the structures of two PostgreSQL databases and returns the differences as a sequence of SQL commands which can be fed to psql to transform the structure of the first to be identical to the second (analagous to diff and patch). There is an advanced Web interface that makes testing and exploration easy. Database schemas can come from live databases, SQL files, or direct input.