2013-05-06 93 views
2

任何人使用這個工具?我想從我的數據庫生成一個ER圖。我跑SchemaSpy這樣的:從postgresql數據庫生成ER圖[SchemaSpy]

java -jar schemaSpy_5.0.0.jar -t pgsql -db mydb -host localhost -dp /home/katie/downloads/postgresql-8.0-312.jdbc3.jar -noschema -u postgres -o . 

,然後,我得到了錯誤:

Using database properties: 
    [schemaSpy_5.0.0. 

    jar]/net/sourceforge/schemaspy/dbTypes/pgsql.properties 
    Gathering schema details..........................................................java.sql.SQLException: ERROR: function information_schema._pg_keypositions() does not exist 
     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471) 
     at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256) 
     at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175) 
     at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389) 
     at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314) 
     at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221) 
     at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3237) 
     at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3533) 
     at net.sourceforge.schemaspy.model.Table.connectForeignKeys(Table.java:106) 
     at net.sourceforge.schemaspy.model.Database.connectTables(Database.java:984) 
     at net.sourceforge.schemaspy.model.Database.<init>(Database.java:83) 
     at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:211) 
     at net.sourceforge.schemaspy.Main.main(Main.java:42) 

我使用PostgreSQL 9.1 Xubuntu的12.04。

+1

針對PostgreSQL的過舊版本(或者新版本,但尚未支持)運行?你的Pg和PgJDBC版本是什麼? – 2013-05-06 12:50:09

+0

@CraigRinger:我使用PostgreSQL-8.0-312.jdbc3.jar和PostgreSQL 9.1 – Katie 2013-05-06 12:52:25

+0

改爲'PostgreSQL相關9.1-901-1.jdbc4.jar',並得到其他錯誤:http://pastie.org/private/sj6ukb4hysxrsa8x4hhnga – Katie 2013-05-06 12:54:26

回答

3

問題被解決:

  • 使用PgJDBC當代到PostgreSQL 9.1數據庫安裝,而不是試圖用PgJDBC 8.0;和
  • 使用JDBC3驅動程序,因爲SchemaSpy似乎不喜歡JDBC4驅動程序。
0

Java的罐子F:/schema/schemaSpy_5.0.0.jar -t PostgreSQL的-db dhis2ccem1 -host本地主機-port 5432 -s公用-u的Postgres -p根-dp F:/schema/postgresql-9.0 -801.jdbc4.jar -o輸出