Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- writing tables to Postgresql using rPostgreSQL when the database name is all capital letters
- library(RPostgreSQL)
- con <- dbConnect(PostgreSQL(), host="myhost",
- user= "postgres", password="myPass", dbname="DATA")
- dbWriteTable(con, "test", myDf)
- Error in postgresqlExecStatement(conn, statement, ...) :
- RS-DBI driver: (could not Retrieve the result : ERROR: no schema has been selected to create in
- )
- [1] FALSE
- edd@max:~$ createdb DATA
- edd@max:~$ psql DATA
- psql (8.4.8)
- Type "help" for help.
- DATA=# q
- edd@max:~$
- R> library(RPostgreSQL)
- R> con <- dbConnect(PostgreSQL(), host="localhost", user= "edd",
- + password=".....", dbname="DATA")
- R> con
- <PostgreSQLConnection:(21936,0)>
- R> dbWriteTable(con, "quicktest", cars)
- [1] TRUE
- R>
- DATA=# select * from quicktest limit 5;
- row_names | speed | dist
- -----------+-------+------
- 1 | 4 | 2
- 2 | 4 | 10
- 3 | 7 | 4
- 4 | 7 | 22
- 5 | 8 | 16
- (5 rows)
- DATA=#
Add Comment
Please, Sign In to add comment