Writing to specific schemas with RPostgreSQL

后端 未结 3 415
孤街浪徒
孤街浪徒 2020-12-14 01:48

I\'m using RPostgreSQL to read and write data. Reading from any schema works perfectly, but I\'m not able to write to non-public schemas. For example, the following code pla

3条回答
  •  感动是毒
    2020-12-14 02:20

    Use this:

    library(RPostgreSQL)
    drv <- dbDriver("PostgreSQL")
    con <- dbConnect(drv, dbname = "db", host = "host", port = 5432,
                     user = "user", password = "pwd")
    dbWriteTable(con, c("yourschema", "yourtable"), value = yourRdataframe)
    dbDisconnect(con)
    

    More details: https://stat.ethz.ch/pipermail/r-sig-db/2011q1/001043.html

提交回复
热议问题