After the Grails update to 2.5.6 / 3.2.8 which contains Groovy 2.4.10 the calls of our PostgreSQL stored procedures stopped working:
ERROR: function exampleproc(unknown, unknown, unknown, unknown) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts
The original code looked like this:
def hasAccess = false sql.call('{? = call exampleproc(?, ?, ?)}', [ Sql.BOOLEAN, user_id), object_id, accesstype ], { ret -> hasAccess = ret })
The fixed call contains type casts:
def hasAccess = false sql.call('{? = call exampleproc(?, ?, ?)}', [ Sql.BOOLEAN, Sql.in(Sql.BIGINT,user_id), Sql.in(Sql.BIGINT,object_id), Sql.in(Sql.CHAR,accesstype) ], { ret -> hasAccess = ret })