BUG #16465: Inconsistent results from comparison of row value expressions

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: lukas(dot)eder(at)gmail(dot)com
Subject: BUG #16465: Inconsistent results from comparison of row value expressions
Date: 2020-05-27 08:00:46
Message-ID: 16465-0ec89f0382fd00db@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16465
Logged by: Lukas Eder
Email address: lukas(dot)eder(at)gmail(dot)com
PostgreSQL version: 12.2
Operating system: Debian 12.2-2.pgdg100+1 (Docker)
Description:

Consider this query:

---------------------------------------------------
SELECT (1, NULL::INT) = (1, NULL::INT), A = B
FROM (SELECT (1, NULL::INT) A, (1, NULL::INT) B) T;
---------------------------------------------------

The result is:

?column?|?column?|
--------|--------|
|true |

It seems the comparison of row value expressions with respect to NULLs is
inconsistent depending on whether the expressions are compared directly
(first column), or indirectly from derived tables (second column). My
reading of the SQL standard is that the second one is incorrect.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2020-05-27 08:00:50 Re: error
Previous Message Michael Paquier 2020-05-27 07:48:53 Re: Re[2]: