Hi Ben, 2015-05-06 13:34 GMT+02:00 Ben Hood <[email protected]>:
> On Tue, May 5, 2015 at 4:59 PM, Lukas Eder <[email protected]> wrote: > > > > This should be sufficient: > > > > $ git clone https://github.com/jOOQ/jOOQ.git > > $ mvn install > > > > Possibly with -Dmaven.test.skip=true in case the Open Source Edition's > tests > > are currently failing... > > The mvn install from 337cd45c installed fine for me with the tests. > > However, I created this two cut down functions: > > CREATE OR REPLACE FUNCTION do_nothing (arg BIGINT) RETURNS SETOF VOID AS $$ > BEGIN > RETURN; > END; > $$ > LANGUAGE plpgsql; > > CREATE OR REPLACE FUNCTION do_something (arg BIGINT) RETURNS SETOF BIGINT > AS $$ > BEGIN > RETURN QUERY SELECT COUNT(*) FROM information_schema.tables; > END; > $$ > LANGUAGE plpgsql; > > And it doesn't look like the code generator is picking this up: > > [INFO] Generating record : DoNothingRecord.java > [INFO] Generating record : DoSomethingRecord.java > > --snip-- > > [INFO] Routines fetched : 0 (0 included, 0 excluded) > Yes, these functions are being treated as tables / table-valued functions, not as routines. There might be a bit of confusion between the different notions here. Historically, jOOQ knows: - Routines, which return a single value that can be used as a column reference in SQL, wherever columns can be used (i.e. an org.jooq.Field) - Table-valued functions, which return a set of values or a set of records that can be used as a table reference in SQL, wherever tables can be used (i.e. an org.jooq.Field) In PostgreSQL, tables and columns are more or less the same, but the jOOQ API still distinguishes these things. Perhaps that's the reason for the confusion here...? Or am I missing something? > Moreover - I also have my proc called set_caller_id in this schema, > which works fine with 3.6.1: > [...] > Here is the error > Thanks for reporting this regression. It is because of: https://github.com/jOOQ/jOOQ/issues/4254 I have fixed this now: https://github.com/jOOQ/jOOQ/commit/98530ee8714ea447881c4440968b32c9d4177bd8 2015-05-06 13:34 GMT+02:00 Ben Hood <[email protected]>: > On Tue, May 5, 2015 at 4:59 PM, Lukas Eder <[email protected]> wrote: > > > > This should be sufficient: > > > > $ git clone https://github.com/jOOQ/jOOQ.git > > $ mvn install > > > > Possibly with -Dmaven.test.skip=true in case the Open Source Edition's > tests > > are currently failing... > > The mvn install from 337cd45c installed fine for me with the tests. > > However, I created this two cut down functions: > > CREATE OR REPLACE FUNCTION do_nothing (arg BIGINT) RETURNS SETOF VOID AS $$ > BEGIN > RETURN; > END; > $$ > LANGUAGE plpgsql; > > CREATE OR REPLACE FUNCTION do_something (arg BIGINT) RETURNS SETOF BIGINT > AS $$ > BEGIN > RETURN QUERY SELECT COUNT(*) FROM information_schema.tables; > END; > $$ > LANGUAGE plpgsql; > > And it doesn't look like the code generator is picking this up: > > [INFO] Generating record : DoNothingRecord.java > [INFO] Generating record : DoSomethingRecord.java > > --snip-- > > [INFO] Routines fetched : 0 (0 included, 0 excluded) > > Moreover - I also have my proc called set_caller_id in this schema, > which works fine with 3.6.1: > > /** > * This class is generated by jOOQ > */ > package se.qall.middleton.jooq; > > > import javax.annotation.Generated; > > import se.qall.middleton.jooq.tables.DoNothing; > import se.qall.middleton.jooq.tables.DoSomething; > import se.qall.middleton.jooq.tables.SetCallerId; > > > /** > * Convenience access to all stored procedures and functions in public > */ > @Generated( > value = { > "http://www.jooq.org", > "jOOQ version:3.7.0" > }, > comments = "This class is generated by jOOQ" > ) > @SuppressWarnings({ "all", "unchecked", "rawtypes" }) > public class Routines { > > /** > * Get <code>public.do_nothing</code> as a field > */ > public static DoNothing doNothing() { > return DoNothing.DO_NOTHING.call(); > } > > /** > * Get <code>public.do_something</code> as a field > */ > public static DoSomething doSomething() { > return DoSomething.DO_SOMETHING.call(); > } > > /** > * Get <code>public.set_caller_id</code> as a field > */ > public static SetCallerId setCallerId() { > return SetCallerId.SET_CALLER_ID.call(); > } > } > > Here is the error: > > > [WARNING] SQL exception : Exception while executing meta > query: ERROR: column parameters.parameter_default does not exist > Position: 427 > > Please report this bug here: https://github.com/jOOQ/jOOQ/issues/new > > select > "information_schema"."parameters"."parameter_name", > "information_schema"."parameters"."data_type", > "information_schema"."parameters"."character_maximum_length", > "information_schema"."parameters"."numeric_precision", > "information_schema"."parameters"."numeric_scale", > "information_schema"."parameters"."udt_name", > "information_schema"."parameters"."ordinal_position", > "information_schema"."parameters"."parameter_mode", > "information_schema"."parameters"."parameter_default" > from "information_schema"."parameters" > where ( > "information_schema"."parameters"."specific_schema" = 'public' > and "information_schema"."parameters"."specific_name" = > 'do_nothing_1321414' > ) > order by "information_schema"."parameters"."ordinal_position" asc > [ERROR] Error while generating table public.do_nothing > org.jooq.exception.DataAccessException: SQL [select > "information_schema"."parameters"."parameter_name", > "information_schema"."parameters"."data_type", > "information_schema"."parameters"."character_maximum_length", > "information_schema"."parameters"."numeric_precision", > "information_schema"."parameters"."numeric_scale", > "information_schema"."parameters"."udt_name", > "information_schema"."parameters"."ordinal_position", > "information_schema"."parameters"."parameter_mode", > "information_schema"."parameters"."parameter_default" from > "information_schema"."parameters" where > ("information_schema"."parameters"."specific_schema" = ? and > "information_schema"."parameters"."specific_name" = ?) order by > "information_schema"."parameters"."ordinal_position" asc]; ERROR: > column parameters.parameter_default does not exist > Position: 427 > at org.jooq.impl.Utils.translate(Utils.java:1645) > at > org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:661) > at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:356) > at org.jooq.impl.AbstractResultQuery.fetch(AbstractResultQuery.java:290) > at org.jooq.impl.SelectImpl.fetch(SelectImpl.java:2316) > at > org.jooq.util.postgres.PostgresRoutineDefinition.init0(PostgresRoutineDefinition.java:119) > at > org.jooq.util.AbstractRoutineDefinition.init(AbstractRoutineDefinition.java:105) > at > org.jooq.util.AbstractRoutineDefinition.getInParameters(AbstractRoutineDefinition.java:122) > at > org.jooq.util.postgres.PostgresTableValuedFunction.getParameters0(PostgresTableValuedFunction.java:196) > at > org.jooq.util.AbstractTableDefinition.getParameters(AbstractTableDefinition.java:159) > at org.jooq.util.JavaGenerator.generateTable(JavaGenerator.java:2827) > at org.jooq.util.JavaGenerator.generateTable(JavaGenerator.java:2697) > at org.jooq.util.JavaGenerator.generateTables(JavaGenerator.java:2684) > at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:305) > at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:265) > at org.jooq.util.GenerationTool.run(GenerationTool.java:429) > at org.jooq.util.GenerationTool.generate(GenerationTool.java:176) > at org.jooq.util.maven.Plugin.execute(Plugin.java:120) > at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) > at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) > at > org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) > at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) > at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:483) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) > at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) > at > org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) > Caused by: org.postgresql.util.PSQLException: ERROR: column > parameters.parameter_default does not exist > Position: 427 > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:412) > at > org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:194) > at org.jooq.impl.AbstractResultQuery.execute(AbstractResultQuery.java:247) > at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:342) > ... 36 more > [INFO] Generating table : DoSomething.java > [input=do_something, output=do_something, pk=N/A] > [WARNING] SQL exception : Exception while executing meta > query: ERROR: column parameters.parameter_default does not exist > Position: 427 > > Please report this bug here: https://github.com/jOOQ/jOOQ/issues/new > > select > "information_schema"."parameters"."parameter_name", > "information_schema"."parameters"."data_type", > "information_schema"."parameters"."character_maximum_length", > "information_schema"."parameters"."numeric_precision", > "information_schema"."parameters"."numeric_scale", > "information_schema"."parameters"."udt_name", > "information_schema"."parameters"."ordinal_position", > "information_schema"."parameters"."parameter_mode", > "information_schema"."parameters"."parameter_default" > from "information_schema"."parameters" > where ( > "information_schema"."parameters"."specific_schema" = 'public' > and "information_schema"."parameters"."specific_name" = > 'do_something_1321415' > ) > order by "information_schema"."parameters"."ordinal_position" asc > [ERROR] Error while generating table public.do_something > org.jooq.exception.DataAccessException: SQL [select > "information_schema"."parameters"."parameter_name", > "information_schema"."parameters"."data_type", > "information_schema"."parameters"."character_maximum_length", > "information_schema"."parameters"."numeric_precision", > "information_schema"."parameters"."numeric_scale", > "information_schema"."parameters"."udt_name", > "information_schema"."parameters"."ordinal_position", > "information_schema"."parameters"."parameter_mode", > "information_schema"."parameters"."parameter_default" from > "information_schema"."parameters" where > ("information_schema"."parameters"."specific_schema" = ? and > "information_schema"."parameters"."specific_name" = ?) order by > "information_schema"."parameters"."ordinal_position" asc]; ERROR: > column parameters.parameter_default does not exist > Position: 427 > at org.jooq.impl.Utils.translate(Utils.java:1645) > at > org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:661) > at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:356) > at org.jooq.impl.AbstractResultQuery.fetch(AbstractResultQuery.java:290) > at org.jooq.impl.SelectImpl.fetch(SelectImpl.java:2316) > at > org.jooq.util.postgres.PostgresRoutineDefinition.init0(PostgresRoutineDefinition.java:119) > at > org.jooq.util.AbstractRoutineDefinition.init(AbstractRoutineDefinition.java:105) > at > org.jooq.util.AbstractRoutineDefinition.getInParameters(AbstractRoutineDefinition.java:122) > at > org.jooq.util.postgres.PostgresTableValuedFunction.getParameters0(PostgresTableValuedFunction.java:196) > at > org.jooq.util.AbstractTableDefinition.getParameters(AbstractTableDefinition.java:159) > at org.jooq.util.JavaGenerator.generateTable(JavaGenerator.java:2827) > at org.jooq.util.JavaGenerator.generateTable(JavaGenerator.java:2697) > at org.jooq.util.JavaGenerator.generateTables(JavaGenerator.java:2684) > at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:305) > at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:265) > at org.jooq.util.GenerationTool.run(GenerationTool.java:429) > at org.jooq.util.GenerationTool.generate(GenerationTool.java:176) > at org.jooq.util.maven.Plugin.execute(Plugin.java:120) > at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) > at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) > at > org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) > at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) > at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:483) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) > at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) > at > org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) > Caused by: org.postgresql.util.PSQLException: ERROR: column > parameters.parameter_default does not exist > Position: 427 > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:412) > at > org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:194) > at org.jooq.impl.AbstractResultQuery.execute(AbstractResultQuery.java:247) > at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:342) > ... 36 more > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
