I am trying to use SchemaSpy with PostgreSQL 8.0.2, but it is throwing an error. I'm seeking guidance on what steps to take to resolve this issue since the documentation is limited. The error message I receive mentions "unsupported server version" and "type does not exist" in the SQL query.
Command:
java -jar schemaspy-6.2.2.jar \
-s public -db <databasename> -u <username> -p <password> \
-host <host> -o /tmp \
-dp /usr/share/java/postgresql-42.6.0.jar \
-debug
error:
INFO - Starting Main v6.2.2 on fs-dev-02 with PID 13334 (/usr/share/java/schemaspy-6.2.2.jar started by frank in /usr/share/java)
INFO - The following profiles are active: default
INFO - Started Main in 1.352 seconds (JVM running for 1.798)
DEBUG - Debug enabled
DEBUG - Resolving dbType: pgsql ->
schemaspy-6.2.2.jar!/BOOT-INF/classes!/org/schemaspy/types/pgsql.properties
INFO - Starting schema analysis
...
WARN - Unsupported Server Version: 8.0.2
DEBUG - supportsSchemasInTableDefinitions: true
DEBUG - supportsCatalogsInTableDefinitions: false
DEBUG - Catalog not provided, queried jdbc driver and got '<redacted database name>'
INFO - Connected to PostgreSQL - 8.0.2
INFO - Gathering schema details
Gathering schema details...ERROR - SqlException
org.postgresql.util.PSQLException: ERROR: type "e" does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:335)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:321)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:297)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:246)
at org.postgresql.jdbc.PgDatabaseMetaData.getTables(PgDatabaseMetaData.java:1347)
at org.schemaspy.input.dbms.service.DatabaseService.getBasicTableMetaFromDatabaseMetaData(DatabaseService.java:510)
at org.schemaspy.input.dbms.service.DatabaseService.getBasicTableMeta(DatabaseService.java:471)
at org.schemaspy.input.dbms.service.DatabaseService.initTables(DatabaseService.java:182)
at org.schemaspy.input.dbms.service.DatabaseService.gatherSchemaDetails(DatabaseService.java:117)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:269)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:134)
at org.schemaspy.cli.SchemaSpyRunner.runAnalyzer(SchemaSpyRunner.java:109)
at org.schemaspy.cli.SchemaSpyRunner.run(SchemaSpyRunner.java:98)
at org.schemaspy.Main.main(Main.java:55)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
I got the above error with postgresql-42.6.0.jar
With postgresql-8.0-325.jdbc3.jar
I got a different error:
WARN - Connection Failure
org.schemaspy.input.dbms.exceptions.ConnectionFailure: Failed to connect to database [redacted] Connection rejected: FATAL: no pg_hba.conf entry for [redacted], SSL off.
at org.schemaspy.input.dbms.DbDriverLoader.getConnection(DbDriverLoader.java:136)
at org.schemaspy.input.dbms.DbDriverLoader.getConnection(DbDriverLoader.java:110)
at org.schemaspy.input.dbms.service.SqlService.connect(SqlService.java:69)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:243)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:134)
at org.schemaspy.cli.SchemaSpyRunner.runAnalyzer(SchemaSpyRunner.java:109)
at org.schemaspy.cli.SchemaSpyRunner.run(SchemaSpyRunner.java:98)
at org.schemaspy.Main.main(Main.java:55)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: org.postgresql.util.PSQLException: Connection rejected: FATAL: no pg_hba.conf entry for host "::ffff:10.131.11.212", user "SRVAMR-STDAWF", database "sdc_analytics_prod", SSL off.
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:275)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:94)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:117)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
at org.postgresql.Driver.connect(Driver.java:235)
at org.schemaspy.input.dbms.DbDriverLoader.getConnection(DbDriverLoader.java:129)
... 15 common frames omitted