handling RS-DBI errors
On Tue, Aug 10, 2010 at 12:50 PM, Homer V Strong <homer.strong at gmail.com> wrote:
Sorry for not being more specific in my first email. I'm using RPostgreSQL and Ubuntu 10.04. The problem is not just the error message prints, but also that R seems to have no idea that an error occurred at all. An error message prints in spite of the silent=T option, and what's much worse, the class of ?`out' is NULL.
You could try the pgSQL postgresql driver in the RpgSQL package. On Windows it works for me:
library(RpgSQL) con <- dbConnect(pgSQL()) out <- try(dbGetQuery(con, "select * from doesnotexist"), silent = TRUE) class(out)
[1] "try-error"
R.version.string
[1] "R version 2.11.1 Patched (2010-05-31 r52167)"
win.version()
[1] "Windows Vista (build 6002) Service Pack 2"