I want to iterate over the elements of two jsonb arrays at once. If it was only one array I know I could simply use json_array_elements and everything would be fine. But for multiple arrays I'm having a hard time to come up with a solution.
Similar to Unnest multiple arrays in parallel, but just for jsonb arrays. So I know that for regular postgres arrays there is unnest(anyarray, anyarray [, ...]).
Here's a snippet of my schematic data scenario:
SELECT *
FROM jsonb_to_recordset('[{"id": 0, "array_a": ["a", "c"], "array_b": ["b" , "d"]}]')
AS example(id jsonb, array_a jsonb, array_b jsonb)
That I want to transform to:
a | b
c | d
Hope someone can help me with that.
Best wishes Andy