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

From: Sylvain Leroux <sl20(at)wanadoo(dot)fr>
To:
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: float4 or real in function parameter -> PSQLException: ERROR function in_test4(double precision) does not exist
Date: 2009-08-05 13:16:33
Message-ID: 4A798631.2090003@wanadoo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2009-08-05 13:17:54 Re: Using BigInteger as argument to AbstractJdbc2Statement.setObject
Previous Message Sylvain Leroux 2009-08-05 13:03:33 Re: Using BigInteger as argument to AbstractJdbc2Statement.setObject