I have this table
CREATE TABLE example (
ID serial NOT NULL PRIMARY KEY,
name varchar(1024),
coords json
);
And I want to write this json in this table:
[
{
"name": "first",
"coords":{
"lat": 3.14,
"lon": 2.5
}
}
]
I am trying with jsonlite and Rpostgresql, but error
I have and application where I have JSON data and uploading it to postgres as it. In that case, I am converting JSON to character and writing it to database.
upload = data.frame(name = name, coords = c(JSONCoords))
dbWriteTable(con, c("table"), value=upload, append=TRUE, row.names=FALSE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With