Re: BUG: IS NOT NULL on RECORD variable fails in 17.5-dev - Mailing list pgsql-bugs

From Peter Praxmarer
Subject Re: BUG: IS NOT NULL on RECORD variable fails in 17.5-dev
Date
Msg-id CABBx1iE1fW3bEGzpxoZObYZqbzvvqS9Fg-Z6S2YAxj0iW6tuow@mail.gmail.com
Whole thread Raw
In response to Re: BUG: IS NOT NULL on RECORD variable fails in 17.5-dev  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
Thank you!

The behavior I was looking for is: 

r IS DISTINCT FROM NULL

Best, 
Peter P.


Am Do., 7. Aug. 2025 um 12:54 Uhr schrieb David G. Johnston <david.g.johnston@gmail.com>:
On Thu, Aug 7, 2025 at 12:44 PM Peter Praxmarer <ppraxmarer@gmail.com> wrote:

I have discovered what appears to be a severe bug in a development version of PostgreSQL 17 where a populated RECORD variable incorrectly fails an IS NOT NULL check. 


Working as documented.  You probably want to test:  NOT (r IS NULL)


If the expression is row-valued, then IS NULL is true when the row expression itself is null or when all the row's fields are null, while IS NOT NULL is true when the row expression itself is non-null and all the row's fields are non-null.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19015: insert-returning failure: stable function in select policy doesn't see before-insert trigger change
Next
From: Tom Lane
Date:
Subject: Re: BUG #19014: Automatic aggressive VACUUM on template0 and template1 pg_shdepend runs every minute