R tricks >

Write a data frame to a PostgreSQL table

library(DBI)

con <- dbConnect(RPostgres::Postgres(), dbname = "my_db", host = "my_host", port = 5432, user = "my_user", password = "my_password")
dbWriteTable(con, "my_table", df, append = FALSE)
dbDisconnect(con)