inconsistent drop schema error

25 views
Skip to first unread message

Manuel Rossetti

unread,
Jul 13, 2018, 10:54:24 PM7/13/18
to jOOQ User Group
I am working with 'jooq', version: '3.10.4' with postgres

Schema schema = // from a call to meta() and finding the right schema
 db.getDSLContext().dropSchema(schema.getName()).execute();// works
db.getDSLContext().dropSchema(schema).execute(); // does not work, see exception below
db.getDSLContext().execute("drop schema jsl_db"); // works

The name of my database is "test" and the schema is obviously "jsl_db"

Exception in thread "main" org.jooq.exception.DataAccessException: SQL [drop schema "test"."jsl_db"]; ERROR: syntax error at or near "."
  Position: 19
	at org.jooq_3.10.4.POSTGRES.debug(Unknown Source)
	at org.jooq.impl.Tools.translate(Tools.java:2239)
	at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:704)
	at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:361)
	at jsl.utilities.reporting.JSLDatabase.dropJSLDbSchema(JSLDatabase.java:345)
	at jsl.utilities.reporting.JSLDatabase.createJSLDatabase(JSLDatabase.java:305)
	at jsl.utilities.reporting.JSLDatabase.createPostgresJSLDatabase(JSLDatabase.java:279)
	at jsl.utilities.reporting.JSLDatabase.createPostgresLocalHostJSLDatabase(JSLDatabase.java:253)
	at ex.queueing.DriverLicenseBureauWithQ.runExperiment(DriverLicenseBureauWithQ.java:264)
	at ex.queueing.DriverLicenseBureauWithQ.main(DriverLicenseBureauWithQ.java:207)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
  Position: 19
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
	at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:144)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
	at org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:209)
	at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:429)
	at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:347)
	... 6 more

Lukas Eder

unread,
Jul 20, 2018, 5:39:22 AM7/20/18
to jooq...@googlegroups.com
Thank you very much for your report. Indeed, the catalog is included in the generated SQL when it shouldn't be. Currently, only SQL Server allows for qualifying objects using the catalog.schema.table scheme.

I've created an issue for this:

There's currently no other workaround than yours, given that runtime catalog mapping has not yet been implemented:

Thanks,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lukas Eder

unread,
Jun 10, 2020, 12:26:21 PM6/10/20
to jOOQ User Group
This issue can no longer be reproduced in jOOQ 3.14: https://github.com/jOOQ/jOOQ/issues/7679. It seems to have been fixed by some other issue
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages