conn <- src_postgres(dbname = 'mydb', host= 'localhost', port= 5432, user = 'myuser', password = 'mypass')
db_insert_into(conn, "INSERT INTO mytable" VALUES ('test', 22))
df = data.frame('foobar', 1234)
copy_to(con, data, name = 'mytable')
dbWriteTable(conn, value = df, name = "testing", append = TRUE)
--
You received this message because you are subscribed to the Google Groups "manipulatr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manipulatr+...@googlegroups.com.
To post to this group, send email to manip...@googlegroups.com.
Visit this group at http://groups.google.com/group/manipulatr.
For more options, visit https://groups.google.com/d/optout.
dfgg = data.frame('fofffof', 3433)
dbWriteTable(con, value = dfgg, name = "mytable", append = T)
Error in postgresqlgetResult(new.con) :
RS-DBI driver: (could not Retrieve the result : ERROR: extra data after last expected column
CONTEXT: COPY stupidarimatest, line 1: "1 fofffof 3433"
)
1)TEXT sometext
2)INT index
dbWriteTable is the correct tool. What happens when you use it?
Hi,--I am fairly new to dplyr and have one question:Is there a way to write / append data to an existing postgres table?I tried the following:
conn <- src_postgres(dbname = 'mydb', host= 'localhost', port= 5432, user = 'myuser', password = 'mypass')
db_insert_into(conn, "INSERT INTO mytable" VALUES ('test', 22))
df = data.frame('foobar', 1234)
copy_to(con, data, name = 'mytable')
dbWriteTable(conn, value = df, name = "testing", append = TRUE)Either it does not work at all, or it tells me that the table already exists (copy_to).Is there a way to write / append data to an existing postgres table from R (maybe using a different tool if dplyr does'nt support this)?Thank you very much for help.Regards,Georg
You received this message because you are subscribed to the Google Groups "manipulatr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manipulatr+unsubscribe@googlegroups.com.
To post to this group, send email to manip...@googlegroups.com.
Visit this group at http://groups.google.com/group/manipulatr.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to manipulatr+...@googlegroups.com.
To post to this group, send email to manip...@googlegroups.com.
Visit this group at http://groups.google.com/group/manipulatr.
For more options, visit https://groups.google.com/d/optout.