JSON Functions and Operators
Returns the number of elements in the outermost JSON array. json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]') Expands the outermost JSON object into a set of key/value pairs. select * from json_each('{"a":"foo", "b":"bar"}') key | value -----+------- a | "foo" b | "bar" setof key text, value text Expands the outermost JSON object into a set of key/value pairs.
https://www.postgresql.org/docs/9.6/functions-json.html