Spludlow Web Header

PostgreSQL - Basics


The management software “pgAdmin” has no diagramming functionality.

Diagramming with PostgreSQL using pgModeler

I had a go with “pgModeler” http://www.pgmodeler.com.br/. Its open source but if you want pre-compiled Windows binaries (software ready to install and use) you have to pay, it’s not much, there are several editions available. The free demo version is limited by only importing 10 objects into a diagram, making it pretty useless. Compiling it yourself is not easy.

To get a diagram from pgModeler

·         Obtain pgModeler, install, and run.

·         Click the “Settings” icon and go to the “Connections” section.

·         The is already a “local-db” connection set up you can use this, just change the password and use the “Test” button then “Apply”. Set up a new connection if your database is not local, use the machine name as the alias.

·         Click the “New” button (sheet of blank paper icon)

·         Click the “Import” button in the left hand panel

·         Select the “local-db” connection on the left hand drop down

·         Select the “usda” database on the right hand drop down

·         Go through the tree and make sure you only have ticked what you want.

·         Click the “Import” – Bingo.


Sample Databases


To install the “usda” sample database.

cd "C:\PostgreSQLSample\usda-r18-1.0"

"C:\Program Files\PostgreSQL\9.5\bin\createdb.exe" -U postgres usda

"C:\Program Files\PostgreSQL\9.5\bin\psql.exe" -U postgres -f usda.sql usda


Allow remote connections

By default remote connections are not available.

C:\Program Files\PostgreSQL\9.5\data\pg_hba.conf

host       all            all                md5

restart service


Spludlow Web Footer