Re: Postgres driver converting null bind values to Byte array

From: Karthik K L V <venkata(dot)karthik4u(at)gmail(dot)com>
To: davecramer(at)postgres(dot)rocks
Cc: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres driver converting null bind values to Byte array
Date: 2022-07-21 05:00:06
Message-ID: CAGpQzhx4idyni+YN024wuq0Zsd=4fcL7X62rh85r7jtj=BP+jA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Dave,

We are using Spring Data JPA and Hibernate framework and passing the bind
value as a String from the java code.
So the framework should be using the setString() method internally if I am
not wrong.

On Thu, Jul 21, 2022 at 12:37 AM Dave Cramer <davecramer(at)postgres(dot)rocks>
wrote:

>
>
>
> On Wed, 20 Jul 2022 at 12:43, Karthik K L V <venkata(dot)karthik4u(at)gmail(dot)com>
> wrote:
>
>> Hi Team,
>>
>> I am facing the below issue while executing a query in Aurora Postgres
>> SQL 13.2 from java application using Spring Data JPA and Hibernate.
>>
>> The query works perfectly fine when the value of the bind variable gets
>> resolved to some value but fails with the below exception when the same
>> bind value gets resolved to null from the java application.
>>
>> *Exception*:
>>
>>
>> *Caused by: org.postgresql.util.PSQLException: ERROR: operator does not
>> exist: text = bytea Hint: No operator matches the given name and argument
>> types. You might need to add explicit type casts. Position: 1037*
>>
>> The value of the bind variable is sent as String from the application and
>> the Datatype of the corresponding Column is Text.
>>
>> Here are the version details.
>>
>> 1. JAVA: 11
>> 2. Postgres Driver: postgresql-42.3.5.jar
>> 3. Server: Aurora Postgres 13.2
>> 4. Executing a prepared statement with Bind values resolved at runtime.
>>
>> Could you please let me know if there is any property available on the
>> Postgres driver which can be configured to avoid converting null object
>> values to Byte array?
>>
>
> I'm guessing you are using setObject ?
> It would be helpful to see the type mapping
>
> Dave Cramer
> www.postgres.rocks
>
>>
>> Appreciate your help.
>> Thank you.
>>
>>
>> --
>> Karthik klv
>>
>

--
Karthik klv

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message μtkarsh 2022-07-21 16:41:47 [pgjdbc/pgjdbc] 6965f8: added search feature and fixed CSS for other brows...
Previous Message Dave Cramer 2022-07-20 19:07:02 Re: Postgres driver converting null bind values to Byte array