pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik@postgresfriends.org>
To: lukas.eder@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Subject: Re: BUG #16465: Inconsistent results from comparison of row value expressions
Date: Wed, 27 May 2020 11:14:13 +0200
Message-ID: <5270dee7-0622-3e59-9bba-0f51bd0a4660@postgresfriends.org> (raw)
In-Reply-To: <16465-0ec89f0382fd00db@postgresql.org>
References: <16465-0ec89f0382fd00db@postgresql.org>

On 5/27/20 10:00 AM, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      16465
> Logged by:          Lukas Eder
> Email address:      lukas.eder@gmail.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.

I concur.

The second one appears to be wrong; it should also return NULL.
-- 
Vik Fearing





view thread (3+ messages)  latest in thread

Message-ID: <5270dee7-0622-3e59-9bba-0f51bd0a4660@postgresfriends.org>
Permalink:  ../5270dee7-0622-3e59-9bba-0f51bd0a4660@postgresfriends.org/
Also on:    postgresql.org/message-id/5270dee7-0622-3e59-9bba-0f51bd0a4660@postgresfriends.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: vik@postgresfriends.org, noreply@postgresql.org
  Subject: Re: BUG #16465: Inconsistent results from comparison of row value expressions
  In-Reply-To: <5270dee7-0622-3e59-9bba-0f51bd0a4660@postgresfriends.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox