Clean Code That Works
Header
Clean Code That Works
Header
Clean Code That Works
Header
Clean Code That Works
Header
Clean Code That Works
Header
Clean Code That Works
Header
Clean Code That Works
Header

Reverse Engineering a PostgreSQL Database

November 10th, 2010 | Posted by Jay in Computing

When working with legacy (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:

RevEng 1 Reverse Engineering a PostgreSQL Database

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.

RevEng 2 Reverse Engineering a PostgreSQL Database

Creating a PostgreSQL User DSN

RevEng 3 Reverse Engineering a PostgreSQL Database

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.

RevEng 4 Reverse Engineering a PostgreSQL Database

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.

RevEng 5 Reverse Engineering a PostgreSQL Database

Visio ODBC Setup

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

RevEng 6 Reverse Engineering a PostgreSQL Database

Example Reverse Engineered Diagram

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

One Response



Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">