BUG #14717: NULL=NULL is true for composite types

From: paolo(dot)guagliardo(at)ed(dot)ac(dot)uk
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14717: NULL=NULL is true for composite types
Date: 2017-06-26 15:29:34
Message-ID: 20170626152934.17677.84281@wrigleys.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: 14717
Logged by: Paolo Guagliardo
Email address: paolo(dot)guagliardo(at)ed(dot)ac(dot)uk
PostgreSQL version: 9.6.3
Operating system: Scientific Linux release 7.3 (Nitrogen)
Description:

Comparisons between row types with NULLs behave as expected:

SELECT (1,NULL) = (1,NULL);

?column?
----------

(1 row)

However, if we now create a composite type:

CREATE TYPE pair AS (a int, b int);

then we get

SELECT (1,NULL)::pair = (1,NULL)::pair ;

?column?
----------
t
(1 row)

while the answer should be NULL (unknown) as before.

Other operations (<>,>,<,>=,<=) are affected as well.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2017-06-26 15:40:26 Re: BUG #14714: long running sessions from remote instance seems to hang some times
Previous Message Greg Stark 2017-06-26 15:03:19 Re: Bus error in formatting.c NUM_numpart_to_char (9.4.12, 9.6.3, sparc)