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

From: Lutz Horn <code(at)lhorn(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres SQL unable to handle Null values for Text datatype
Date: 2022-09-06 06:25:29
Message-ID: 3FD5BCF2-345C-4814-8657-B2E1E39D02CB@lhorn.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> 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://stackoverflow.com/a/54223586
[1] https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lahnov, Igor 2022-09-06 06:46:38 RE: Unable to start replica after failover
Previous Message Karthik K L V 2022-09-06 06:10:39 Postgres SQL unable to handle Null values for Text datatype