Re: BUG #18451: NULL fails to coerce to string when performing string comparison

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Darryl Dixon <darryl(dot)dixon(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18451: NULL fails to coerce to string when performing string comparison
Date: 2024-04-30 22:07:01
Message-ID: 1822025.1714514821@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Darryl Dixon <darryl(dot)dixon(at)gmail(dot)com> writes:
> The bug is that:
> 1) The concatenation is not producing NULL, but rather Text, and yet the
> comparison fails regardless, and
> 2) The explicit CAST of NULL -> Text fails to remedy this.

I wonder what you think NULL means. You certainly don't appear to
understand its semantics at all. Every SQL data type allows NULL
as a value, so "casting NULL to text" doesn't change the value,
only what type the parser deems it to have.

> Further examples below:

Every one of these looks as-expected to me.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2024-04-30 22:08:41 Re: BUG #18451: NULL fails to coerce to string when performing string comparison
Previous Message Thomas Munro 2024-04-30 21:50:15 Re: BUG #18452: [PostgreSQL and 16.1]: [Postgres.exe crash observed while installing the application]