[R-sig-DB] handling RS-DBI errors

Gabor Grothendieck ggrothend|eck @end|ng |rom gm@||@com
Tue Aug 10 19:11:43 CEST 2010


On Tue, Aug 10, 2010 at 12:50 PM, Homer V Strong <homer.strong using 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"




More information about the R-sig-DB mailing list