Operators and functions
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

From string to jsonb
Updating a column from a varchar to jsonb
I'm trying to update a column from a varchar type column into a JSON but the column is already filled in with chars that are numeric or string or a hash. How can I cast them to turn into a JSON nex...
https://stackoverflow.com/questions/49710935/updating-a-column-from-a-varchar-to-jsonb
