Depending on referential integrities ZPostgresUtils generates a database diagram.
At this time ZPostgresUtils is a ZClass based product.
It works with RDBMS PostgreSQL 7.0 or later.
Assuming you setup the following tables ...
CREATE TABLE title (
titleid SERIAL NOT NULL,
title character varying(50))
CREATE TABLE customer (
customerid SERIAL NOT NULL,
name character varying(75),
city character varying(50),
street character varying(75),
phone character varying(20),
fax character varying(20))
CREATE TABLE orders (
orderid SERIAL NOT NULL,
customerid int4 NOT NULL REFERENCES customer (customerid) ON DELETE RESTRICT ON UPDATE CASCADE INITIALLY DEFERRED,
what character varying(60),
deadline date)
CREATE TABLE invoice (
invoiceid SERIAL NOT NULL,
orderid int4 NOT NULL CONSTRAINT fororders REFERENCES orders (orderid) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
amount float8)
... you will get this output:
Tables and Views with referential integrity definition
customer |
customerid | orders | orderid | invoice | invoiceid | orderid | amount |
| customerid | what | deadline |
| name | city | street | phone | fax |
Tables and Views without any referential integrity definition
Name | Type | Fields |
title | table | titleid,title, |
Referential integrities
Table | Source Table | Source Field | Destination Table | Destination Field | is Foreign Key | Descr. | Deferrable | Initially Deferred | Constraint Name | MATCH |
customer | customer | customerid | orders | customerid | 0 | ON DELETE RESTRICT | f | f | | UNSPECIFIED |
customer | customer | customerid | orders | customerid | 0 | ON UPDATE CASCADE | t | t | | UNSPECIFIED |
orders | orders | orderid | invoice | orderid | 0 | ON DELETE RESTRICT | f | f | fororders | FULL |
orders | orders | orderid | invoice | orderid | 0 | ON UPDATE CASCADE | f | f | fororders | FULL |
orders | customer | customerid | orders | customerid | 1 | FOREIGN KEY ... REFERENCES | t | t | | UNSPECIFIED |
invoice | orders | orderid | invoice | orderid | 1 | FOREIGN KEY ... REFERENCES | f | f | fororders | FULL |