How to write to database schema other than public using RPostgreSQL
On Sat, Mar 5, 2011 at 9:16 PM, Tomoaki NISHIYAMA
<tomoakin at kenroku.kanazawa-u.ac.jp> wrote:
Hi, Did you use dbSendQeury() to change the search path or dbGetQeury() ?
I have tried both, both failed, the last error is because there is already table named rtest.
dbGetQuery(con, "set search_path to amber,public;")
NULL
dbGetQuery(con, "show search_path;")
search_path 1 amber, public
dbWriteTable(con, "rtest", df, row.names=FALSE)
[1] FALSE Warning message: In postgresqlWriteTable(conn, name, value, ...) : table rtest exists in database: aborting assignTable
As explained in the mail on 1 March on [R-sig-DB], dbSendQuery just sends the query but does not finish the query and other connection is created for later queries, which results as if the effect is not taken place. https://stat.ethz.ch/pipermail/r-sig-db/2011q1/001032.html