"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