Graphical Visualization of databases with PostgreSQL Autodoc

When it comes to software, database systems are beneficial in many ways. They offer us to keep our data organized and a fast way to access them. However as the number of components in a software project increases, it gets harder to preserve the organized structure. In situations like this, visualizing the scheme helps to understand the structure and the relations between the tables.

PostgreSQL Autodoc provides simple tools for description of the PostgreSQL databases in various formats such as HTML, DocBook, Dia and GraphViz. Although I do not have a complicated database scheme in my GSoC project, visualization shortened the time spent creating mock-ups. In order to generate a graphic in PNG format, first we need to install PostgreSQL Autodoc:

yum install postgresql_autodoc

Then we create a GraphViz compatible description of our database:

postgresql_autodoc -t dot -h hostname -u username -d databasename --password

Finally using the dot utility from GraphViz, we can export a PNG image:

dot -Tpng -o image.png