I have a table which includes jsonb column "details" with wrong data type as follow:
select id,details from products;
id | details
---+-----------------------------------------
1 | {"price": "310", "supplier": "VendorA"}
2 | {"price": "250", "supplier": "VendorB"}
Here I would like to change data type of "price" to integer which is stored as string currently. Desired result is as follows:
id | details
---+-----------------------------------------
1 | {"price": 310, "supplier": "VendorA"}
2 | {"price": 250, "supplier": "VendorB"}
I will appreciate if you can guide me how to achieve it?