Postgres jsonb_object_keys limiting result set

52 views Asked by At

Can someone explain to me why jsonb_object_keys can limit my result set?

I would expect the following to return 2 rows: 1,3 2,null

But the last one is filtered out.

     SELECT
 idx,
        jsonb_object_keys(json_data::jsonb -> '2')
 FROM
     (
     SELECT 1 as idx, '{"1":"val","2":{"3": "val"}}' as json_data
         UNION ALL
     SELECT 2 as idx, '{"1":"val"}' as json_data
     ) a

Version: PostgreSQL 11.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit

0

There are 0 answers