In Postgresql is there a way to flatten or aggregate nested JSONB arrays that can be used with generated stored columns?
So imagine I have a table with a jsonb column data
(for the sake of example, not because it’s a good column name) that contains an array of json objects with a key states
that is an array of USA state abbreviations: