5

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
(source: google.com)

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?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
  • I assume that you are using Windows, but for Linux, visit http://stackoverflow.com/questions/898255/any-good-postgresql-client-for-linux – Esteban Küber Dec 30 '09 at 06:45
  • Since this is a paying product, you should ask their support about it. AUTO_INCREMENT is not supported by many DBMS, at least not by PostgreSQL, Oracle, or SQL Server – chburd Dec 30 '09 at 10:57

2 Answers2

2

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
  • 14,156
  • 17
  • 75
  • 124
1

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

Esteban Küber
  • 36,388
  • 15
  • 79
  • 97
  • 1
    Do you mean phppgadmin? No! I do not want web based tool. I am working on my standalone machine. – Cheok Yan Cheng Dec 30 '09 at 06:35
  • 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 – Cheok Yan Cheng Dec 30 '09 at 06:46
  • Really? http://squirrel-sql.sourceforge.net/screenshots/graph.png http://druid.sourceforge.net/#Features http://www.youtube.com/watch?v=fIYtbdamzp8&feature=player_embedded http://dba.openoffice.org/drivers/postgresql/index.html#features – Esteban Küber Dec 30 '09 at 06:54
  • How does PgAdmin answer the OP's needs? (I'm not aware of a graphical way to see the schema in PgAdmin...) – Assaf Lavie Dec 30 '09 at 10:56