Re: subselect removes rows
| От | Tom Lane |
|---|---|
| Тема | Re: subselect removes rows |
| Дата | |
| Msg-id | 1217100.1638198095@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | subselect removes rows ("Poot, Bas (B.J.)" <bas.poot@politie.nl>) |
| Ответы |
Re: subselect removes rows
|
| Список | 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 по дате отправления: