This article was first written in June 2004 for the BeezNest technical
is a powerful and useful tool to document a PostgreSQL database. It is written in Perl and generates several outputs.
Using it is as simple as launching it with the name of the DB, and user and password to connect to it. See postgresql_autodoc --help
output is not really useful or practical, because all the tables will get on the same place of the Dia document (ie they will all be on top of each other).
The Dot output is a text output meant to be processed by GraphViz
(or a compatible program such as Springgraph
) to generate graph from it.
It seemed particularly difficult to get a printed version, so I explain here how I got it to work for a medium-sized graph on an A3 printer, on a Debian system with packages graphviz
I used dotty which is a graphical tool to see and edit the .dot file. To print it, I went into the menu available on right-click and print graph
. There, it asks if you want to print on a file (PostScript output) or on a printer. I chose printer
. There, it asks which command-line to use to print. I replaced the call from lpr to xpp, which is interactive. There, it asks for the size and orientation you want. Choose whatever best suite your needs (ie the size of your DB schema). I chose 11x17
and best fit
and it launched XPP
, where I changed page size to A3
and clicked on button Print
And guess what? I have my schema printed as I like!