dbConnect-methods {RPostgreSQL} | R Documentation |
These methods are straight-forward implementations of the corresponding generic functions.
PostgreSQLDriver
, or
the character string "PostgreSQL" or an PostgreSQLConnection
.
PostgreSQLConnection
object as produced by dbConnect
.
A connection between R/S-Plus and an PostgreSQL server is established. The current implementation supports up to 100 simultaneous connections.
See the Database Interface definition document
DBI.pdf
in the base directory of this package
or http://stat.bell-labs.com/RS-DBI.
PostgreSQL
,
dbConnect
,
dbSendQuery
,
dbGetQuery
,
fetch
,
dbCommit
,
dbGetInfo
,
dbReadTable
.
## Not run: # create an PostgreSQL instance and create one connection. drv <- dbDriver("PostgreSQL") # open the connection using user, passsword, etc., as con <- dbConnect(drv, dbname = "postgres") # Run an SQL statement by creating first a resultSet object rs <- dbSendQuery(con, statement = paste( "SELECT itemCode, itemCost, itemProfit", "FROM sales", "SORT BY itemName")); # we now fetch records from the resultSet into a data.frame df <- fetch(rs, n = -1) # extract all rows dim(df) ## End(Not run)