I have a table with a column of type jsonb called attributes
.
I have rows with values like –
{
"id1": "something1",
"id2": "something2",
"id3": "something3",
}
and I want to convert them into –
{
"id1": ["something1"],
"id2": ["something2"],
"id3": ["something3"],
}
How can I do that?
Best Answer
You would have to unroll it with
jsonb_to_record
or write a function in plv8,