2

Anyone use this tool? I wanted to generate a ER diagram from my database. I run SchemaSpy like this:

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 .

and then, I got errors:

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)

I use PostgreSQL 9.1 on Xubuntu 12.04.

Katie
  • 3,517
  • 11
  • 36
  • 49
  • 1
    Running against a too-old (or too-new and not yet supported) version of PostgreSQL maybe? What's your Pg and PgJDBC version? – Craig Ringer May 06 '13 at 12:50
  • @CraigRinger: I use postgresql-8.0-312.jdbc3.jar and PostgreSQL 9.1 – Katie May 06 '13 at 12:52
  • Changed to `postgresql-9.1-901-1.jdbc4.jar` and got other errors: http://pastie.org/private/sj6ukb4hysxrsa8x4hhnga – Katie May 06 '13 at 12:54
  • 1
    Well, using a truly ancient PostgreSQL JDBC driver wouldn't do any good. The newer error suggests that you might be using the driver on a too-old JDK; maybe try the JDBC3 driver if you're on JDK 1.4 or older. – Craig Ringer May 06 '13 at 12:59
  • @CraigRinger thanks for help :) Did it finally with command: `java -jar schemaSpy_5.0.0.jar -t pgsql -db mydb -host localhost -dp /home/katie/downloads/postgresql-9.2-1002.jdbc3.jar -noschema -u postgres -o ./output` I use JDK 1.7, PostgreSQL 9.1 on Xubuntu 12.04. Cheers :D – Katie May 06 '13 at 13:05

2 Answers2

3

Issues were resolved by:

  • Using a PgJDBC contemporary to the PostgreSQL 9.1 database install, instead of trying to use PgJDBC 8.0; and
  • Using the JDBC3 driver, as SchemaSpy didn't seem to like the JDBC4 driver.
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
0

java -jar F:/schema/schemaSpy_5.0.0.jar -t postgresql -db dhis2ccem1 -host localhost -port 5432 -s public -u postgres -p root -dp F:/schema/postgresql-9.0-801.jdbc4.jar -o output