jklingsporn / vertx-jooq

A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.
MIT License
385 stars 53 forks source link

Calls to postgres polymorphic functions fail #162

Open ashertarno opened 4 years ago

ashertarno commented 4 years ago

The following call:

ReactiveRXGenericQueryExecutor executor =... executor.query(dslCtx -> dslCtx.selectFrom(DSL.generateSeries(3, 10)))...

will return error io.vertx.pgclient.PgException: function generate_series(unknown, unknown) is not unique

This happens because while all of the queries are turned into prepared statements by AbstractReactiveQueryExecutor.toPreparedQuery() using ParamType.NAMED, such usage isn't allowed in cases of postgres polymorphic functions like generate_series. The usage for such functions in prepared statements is possible only with explicitly cast parameters, e.g. generate_series($1::int,$2::int), while they work without any issues in regular statements.