Re: subselect removes rows - Mailing list pgsql-bugs

From Tom Lane
Subject Re: subselect removes rows
Date
Msg-id 1217100.1638198095@sss.pgh.pa.us
Whole thread Raw
In response to subselect removes rows  ("Poot, Bas (B.J.)" <bas.poot@politie.nl>)
Responses Re: subselect removes rows
List pgsql-bugs
"Poot, Bas (B.J.)" <bas.poot@politie.nl> writes:
> The bug is as follows:
> When using certain commands in a sub-select, it removes the row.
> This should never happen. It should return null instead. It worked in postgres 10, but somehow doesn't work anymore
onpostgres 13 (which we currently have) 

> Example query:

> select
> col1, col2, jsonb_each_text(col2)
> from (
> select 1 as col1, null::jsonb as col2
> union all
> select 1 as col1, '{"a":"2"}'::jsonb as col2
> ) t1

Your claim is quite unclear ... but AFAICS, that query produces exactly
the same results in v10 as in later versions.

regression=# select
col1, col2, jsonb_each_text(col2)
from (
select 1 as col1, null::jsonb as col2
union all
select 1 as col1, '{"a":"2"}'::jsonb as col2
) t1
;
 col1 |    col2    | jsonb_each_text
------+------------+-----------------
    1 | {"a": "2"} | (a,2)
(1 row)

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17303: statement_timeout does not work always
Next
From: "Poot, Bas (B.J.)"
Date:
Subject: Re: subselect removes rows