I'm using PostgreSQL 9.4.5, 64 bit on windows.
I've got some irregular sized arrays. I want to use
json_array_elements
to expand the arrays similar to the following code
with outside as (select (json_array_elements('[[],[11],[21,22,23]]'::json)) aa, json_array_elements('[1,2,3]'::json)bb)
select json_array_elements_text(aa), bb from outside
However, when i run this, i get
aa | bb
-------
11 | 2
21 | 3
22 | 3
23 | 3
The empty array in column aa is dropped on the floor along with the the value of 1 in column bb
I would like to get
aa | bb
----------
null | 1
11 | 2
21 | 3
22 | 3
23 | 3
Also, is this a bug in PostgreSQL?