BUG #15256: Comparing if a rowtype is null

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: anderson(dot)ant(dot)oli(at)gmail(dot)com
Subject: BUG #15256: Comparing if a rowtype is null
Date: 2018-06-29 21:06:21
Message-ID: 153030638143.13254.5368602818503806766@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: 15256
Logged by: Anderson Antunes
Email address: anderson(dot)ant(dot)oli(at)gmail(dot)com
PostgreSQL version: 9.3.5
Operating system: Windows
Description:

Hello. My name is Anderson Antunes. I'm from Brazil. I'd like to get more
information about the behavior of the query below using comparison
operators. From what I understand in the query result below, a composite
type variable is only null when all values are null. Similarly, a variable
is not null when all values are not null. However, when we have written a
null value and a non-null value, the "is_null" and "is not null" columns
remain false. I believe that if we have at least a pre-set value, the
operator should recognize that this variable is not null.
I hope you have understood what I think.

SELECT
r,
r IS NULL AS "is null",
r IS NOT NULL AS "is not null"
FROM (VALUES(NULL,NULL), (5, NULL), (5, 5)) r

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2018-06-29 21:16:11 Re: BUG #15256: Comparing if a rowtype is null
Previous Message Ekaterina Dimitrova 2018-06-29 19:47:19 Re: Inability to init db Postgresql-9.1.1 on Ubuntu