Looping through JSON and insert data to Postgres DB
You need to combine two jsonb_array_elements() calls:

select c.cases -&gt;&gt; 'id' as id,
       c.cases -&gt;&gt; 'class_name' as class_name
from the_table
  cross join jsonb_array_elements(the_column -&gt; 'suites') as s(suite)
  cross join jsonb_array_elements(s.suite -&gt; 'cases') as c(cases);


Online example