Postgres SQL unable to handle Null values for Text datatype

2022-09-05 Thread Karthik K L V
Hi Team, We are migrating from Oracle 12C to Aurora Postgres 13 and running into query failures when the bind value of a Text datatype resolves to null. The same query works fine in Oracle without any issues. We use SpringDataJPA and Hibernate framework to connect and execute queries and the appl

Re: Postgres SQL unable to handle Null values for Text datatype

2022-09-05 Thread Lutz Horn
> org.postgresql.util.PSQLException: ERROR: operator does not exist: character > varying = bytea This has been discussed on Stack Overflow[0]. The answer with the highest approval suggests to use coalesce[1]: ``` Select * from A where middle_name = coalesce(?1) ``` Lutz [0] https://stackover

Re: Postgres SQL unable to handle Null values for Text datatype

2022-09-06 Thread Mladen Gogala
On 9/6/22 02:10, Karthik K L V wrote: We are migrating from Oracle 12C to Aurora Postgres 13 and running into query failures when the bind value of a Text datatype resolves to nul Oracle is actually in the wrong here. Nothing should be equal to null, ever. There is also different behavior with

Re: Postgres SQL unable to handle Null values for Text datatype

2022-09-06 Thread Christophe Pettus
> On Sep 5, 2022, at 23:10, Karthik K L V wrote: > The above query fails with the below exception when the value of ?1 resolves > to null. > org.postgresql.util.PSQLException: ERROR: operator does not exist: character > varying = bytea > Hint: No operator matches the given name and argument