Re: float4 or real in function parameter -> PSQLException: ERROR function in_test4(double precision) does not exist - Mailing list pgsql-jdbc

From Sylvain Leroux
Subject Re: float4 or real in function parameter -> PSQLException: ERROR function in_test4(double precision) does not exist
Date
Msg-id 4A798631.2090003@wanadoo.fr
Whole thread Raw
In response to float4 or real in function parameter -> PSQLException: ERROR function in_test4(double precision) does not exist  (Michael Schwipps <msc.listen@online.de>)
List pgsql-jdbc
Hi,

Michael Schwipps a écrit :
 > Hi,
 >
 > We use database functions in our application.
 >
 > Today I want to use a float4/real Parameter for the first time. You can
 > see a sample in in_test4.
 > Float8/double-parameters run fine.
 >
 > in psql, everything runs fine.
 >
 > Is it a bug in the JDBC-driver?

I have my nose just on it: in AbstractJdbc2Statement.java float
parameters are passed as FLOAT8 (just like in setDouble):
 >     public void setFloat(int parameterIndex, float x) throws SQLException
 >     {
 >         checkClosed();
 >         bindLiteral(parameterIndex, Float.toString(x), Oid.FLOAT8);
 >     }

I'm new here, but I think it should be a FLOAT4. Try to change it in the
source code of the driver to see if it works after that.


Best regards,
Sylvain Leroux



pgsql-jdbc by date:

Previous
From: Sylvain Leroux
Date:
Subject: Re: Using BigInteger as argument to AbstractJdbc2Statement.setObject
Next
From: Oliver Jowett
Date:
Subject: Re: Using BigInteger as argument to AbstractJdbc2Statement.setObject