Closed noamanemobidata closed 3 years ago
Hello! I try to reproduce the example :
library(dbx) library(RPostgres) dbx <- dbxConnect(adapter="RPostgres", dbname=Sys.getenv('db'), host =Sys.getenv("host"), user = Sys.getenv("uid"), password = Sys.getenv("pwd"), sslmode="require", options="-c search_path=m2", port = 5432) dbWriteTable(dbx, SQL("m2.test"), data.frame(id=1:3, temperature=20:22), overwrite=T) records <- data.frame(id=c(3, 4), temperature=c(20, 25)) dbxUpsert(dbx, SQL("m2.test"), records, where_cols=c("id"))
It returns this error
Error: Failed to fetch row: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification
Solved by adding a unique index in the table
Hello! I try to reproduce the example :
It returns this error
Error: Failed to fetch row: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification