Dr. Julian Timpner

Reverse Engineering a PostgreSQL Database

When working with relational databases it might come in handy to visualize an existing schema. Microsoft Visio supports such a reverse engineering of most databases in a remarkably easy way. This little tutorial assumes that the database to be reverse engineered is a PostgreSQL installation.

Therefore, the first thing you need to do is to install the PostgreSQL ODBC driver.

Second, you can start Visio and create a new “Database Model Diagram”. Select the “Database” tap, and your window should look like this:

Visio Reverse Engineering

Now, select ‘Reverse Engineer’ and create a new data source. Choose “User Data Source” and “PostgreSQL Unicode”, as seen in the following screenshots. Enter your database connection credentials and test it.

Creating a PostgreSQL User DSN

Creating a PostgreSQL User DSN

If the User Data Source was successfully added, you should be able to select the “Generic ODBC Driver” and the specified PostgreSQL data source.

Visio Generic ODBC Driver

After filling in the correct username and password, you can for instance specify which object types you’d like to reverse engineer.

Visio ODBC Setup

The result of this process is a nicely layouted diagram of the corresponding database.

Example Reverse Engineered Diagram