Extract key, value from json objects in Postgres
问题 I have a Postgres table that has content similar to this: id | data 1 | {"a":"4", "b":"5"} 2 | {"a":"6", "b":"7"} 3 | {"a":"8", "b":"9"} The first column is an integer and the second is a json column. I want to be able to expand out the keys and values from the json so the result looks like this: id | key | value 1 | a | 4 1 | b | 5 2 | a | 6 2 | b | 7 3 | a | 8 3 | b | 9 Can this be achieved in Postgres SQL? What I've tried Given that the original table can be simulated as such: select *