mplourde / rpostgresql

Automatically exported from code.google.com/p/rpostgresql
0 stars 1 forks source link

dbWriteTable incompatible with non-default schemas #75

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
> What steps will reproduce the problem?

library(RPostgreSQL)
con <- dbConnect(XXXyourPostgreSQLsettingsXXX)

dbGetQuery(con, 'CREATE SCHEMA t1;')
dbWriteTable(con, 't1.test1', as.data.table(c(2)), append=T, row.names=F)
dbGetQuery(con, 'SELECT * FROM t1.test1;')
dbGetQuery(con, 'SELECT * FROM public."t1.test1";')

First select query shouldn't throw and error, and the second one should.  You 
probably know about this problem (a known bug is referenced in the "SET 
search_path" workaround described here: 
http://stackoverflow.com/questions/10032390/writing-to-specific-schemas-with-rpo
stgresql
) but I thought I'd post it anyways.  

Versions:
OS X 10.10.2
R 3.1.2
PostgreSQL 9.3.4.1 (23)
RPostgreSQL 0.4
DBI 0.3.1

Original issue reported on code.google.com by seth.f...@disneyresearch.com on 1 Apr 2015 at 10:50

GoogleCodeExporter commented 9 years ago
Oh, and doing the CREATE TABLE through dbGetQuery works fine.  It's only 
dbWriteTable that fails to recognize the period as a schema delimiter.

Original comment by seth.f...@disneyresearch.com on 1 Apr 2015 at 10:52