Schema difference
When one works on a new version of the database schema for an application, sometimes, it is necessary to understand the difference between the old and new structure. This information is used in release notes, and it can also be analyzed to check if the changes might have any undesired impact on other applications.
The differences can be found using conventional command-line utilities.
For example, suppose one changed the structure of the car portal database, which is used as a sample database in this book. The script to create the database is in the addendum. To learn how to create a database and how to use the psql console and other PostgreSQL utilities, please refer to the previous chapters.
First, let's create another database which will contain the updated schema:
user@host:~$ createdb car_portal_new -T car_portal -O car_portal_app
Now there are two identical databases. Then, deploy the changes in the schema to the new database:
user@host:~$ psql car_portal_new psql...