Skip to content

Instantly share code, notes, and snippets.

@mbannert
Created February 16, 2015 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbannert/8a85d219a5b363e31985 to your computer and use it in GitHub Desktop.
Save mbannert/8a85d219a5b363e31985 to your computer and use it in GitHub Desktop.
dbIsValid method for RPostgreSQL
setMethod("dbIsValid", "PostgreSQLConnection", function(dbObj, ...) {
isValid <- tryCatch({dbGetInfo(dbObj)},
error = function(e) NULL)
!is.null(isValid)
})
@rsaporta
Copy link

thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment