pgCon: Connect to a PostgreSQL database

Description Usage Arguments Details Examples

Description

Connect to a PostgreSQL database

Usage

1
2
  pgCon(auth.list = getOption("pg.auth", stop("Need to provide a list of authorization args with elements host, user, password, dbname, port")),
    drv.name = "PostgreSQL")

Arguments

auth.list

a list including authorization arguments including host, user, password, dbname, port

drv.name

database driver to use for DBI ('PostgreSQL' on mac/linux)

Details

constructs a databse connection using DBI-compliant connection via RPostgreSQL package returns list of connection and driver.

Examples

1
2
3
4
5
6
7
## Not run: 
options(pg.auth =  alist(host="localhost", user="user", password="", dbname="", port="5432"))
## make a connection
c <- pgCon()
pgDiscon(c)

## End(Not run)

ashander/use-PostgreSQL documentation built on May 12, 2019, 4:40 a.m.