I have a table with type varchar[]
| Field Name | Field Type |
|---|---|
| id | int |
| data | varchar[][] |
| insert_date | timestamps |
I have a data json object
{
{
name : "Mr. A",
class:
{
class_id: 1,
exam: 95,
},
{
class_id: 2,
exam: 78,
}
},
{
name : "Mr. B",
class:
{
class_id: 1,
exam: 87,
},
{
class_id: 2,
exam: 87,
}
}
}
how do i insert the data into 1 row?
varchar[]) is pretty much always a bad idea. But it's totally unclear to me what exactly you are trying to store into the table. I can't relate any of the JSON keys to the columns in your table. Why don't you just store the JSON value into ajsonbcolumn?