views:

132

answers:

2

Currently, I am using standalone GUI tool DbSchema to design my database schema.

I like it because it can

  1. Generate SQL code.
  2. Have graphing view on my entire database schema.

alt text

However, I realize the SQL code generate by DbSchema is not being recognized by PostgreSQL.

CREATE TABLE lot (
    lot_id    serial AUTO_INCREMENT NOT NULL,
    operator_name    text,
    machine_name    text,
    timestamp    timestamp,
    CONSTRAINT pk_lot_id PRIMARY KEY(lot_id)) 

CREATE TABLE unit (
    unit_id    serial AUTO_INCREMENT NOT NULL,
    fk_lot_id    serial NOT NULL,
    CONSTRAINT pk_unit_id PRIMARY KEY(unit_id),
    CONSTRAINT fk_lot_id FOREIGN KEY( fk_lot_id ) REFERENCES lot ( lot_id )) 

I get the error :

org.postgresql.util.PSQLException: ERROR: syntax error at or near "AUTO_INCREMENT"

Is there any alternative "just work" free tool that I can work with PostgreSQL, by providing above 2 features?

+1  A: 

Depending on what platform you are working you have some options:

voyager
Do you mean phppgadmin? No! I do not want web based tool. I am working on my standalone machine.
Yan Cheng CHEOK
But after I go through the list of their web site, non of them has the "diagram layout" feature as here : http://www.dbschema.com/screenshots.html
Yan Cheng CHEOK
voyager
How does PgAdmin answer the OP's needs? (I'm not aware of a graphical way to see the schema in PgAdmin...)
Assaf Lavie
+1  A: 

I like the VisualUML/DBA kit. Its not free but it sure is nice. It'll do what you are asking for and it'll generate the DB (with your favorite DBMS) create/drop script for you.

monksy