Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. library(dplyr)
  2. library(DBI)
  3. library(RPostgres)
  4. library(tibble)
  5.  
  6. conn <- dbConnect(RPostgres::Postgres(),
  7. host = url$host,
  8. port = url$port,
  9. dbname = url$dbname,
  10. user = url$user,
  11. password = url$password
  12. )
  13.  
  14. test <- tibble(
  15. words = c("hallo","ja", "nein"),
  16. value = c(3,4,5),
  17. time= as.POSIXct(c("2016-05-04 04:32","2016-06-02 09:37","2016-07-12 010:43")))
  18. test2 <- tibble(
  19. words = c("hallo","ja", "nein"),
  20. value = c(3,4,5),
  21. time= c("2016-05-04 04:32","2016-06-02 09:37","2016-07-12 010:43"))
  22.  
  23. dbWriteTable(conn = conn, name = "words", value = test)
  24. > Error: Table fruits exists in database, and both overwrite and append are FALSE
  25. dbWriteTable(conn = conn, name = "words2", value = test2)
  26. > [1] TRUE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement