I have a table master_data_approval_table in my postgres DB having field approval_value (type Jsonb) which contains below JSON structure:
[{
"name": "abc",
"email": "abc.pqr@gmail.com"
},
{
"name": "xyz",
"email": "xyz.pqr@gmail.com"
}
]
Now we want to add one more key-value pair i.e. "comment": null in each object of the array like the below one:
[{
"name": "abc",
"email": "abc.pqr@gmail.com",
"comment": null
},
{
"name": "xyz",
"email": "xyz.pqr@gmail.com",
"comment": null
}
]
In more to that we need to do this for all the records of the table. I have tried different existing answers and queries but no help so please somebody guide me on how to write a query in PostgreSQL for the above scenario.
Thanks in advance.