Re: BUG #18583: jsonb_populate_record return values cannot be queried correctly in subselects - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #18583: jsonb_populate_record return values cannot be queried correctly in subselects
Date
Msg-id CAKFQuwYDf41N4a-HzCtOzdvUXgUWCMTMFNDsN0hoA3ksMYHbBw@mail.gmail.com
Whole thread Raw
In response to BUG #18583: jsonb_populate_record return values cannot be queried correctly in subselects  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18583: jsonb_populate_record return values cannot be queried correctly in subselects
List pgsql-bugs
On Wednesday, August 14, 2024, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      18583
Logged by:          Robert Greig
Email address:      robert.j.greig@gmail.com
PostgreSQL version: 16.4
Operating system:   Windows
Description:       

create type test_simple_type as (
        f1 varchar(20),
        f2 int
);

where val is not null;

It is not obvious to me why it is not working but I believe this is a defect
and I can't find a workaround.

The “workaround” is to write that test:  not (val is null)

The meaning of is not null for a composite is non-intuitive and usually not what you want - i.e., true only if all fields are also non-null.

The docs do cover this, and there is a pending patch to further expand on how null values are handled in various places in PostgreSQL.

David J.

pgsql-bugs by date:

Previous
From: Jacob Champion
Date:
Subject: Re: TLS session tickets disabled?
Next
From: Kuntal Ghosh
Date:
Subject: Re: BUG #18559: Crash after detaching a partition concurrently from another session