Setting up Postgresql

First install postgresql, create a data directory, and create a default database.

# brew update
# brew unlink postgresql
brew install postgresql
export PGDATA=~/db/postgres-9.5 # set this globally somewhere
initdb -E utf8
createdb
createdb lahman
createdb nycflightd13
```pos

Then on reboot run

pg_ctl start

## Check connection

From R,

```r
install.packages("RPostgreSQL")
library(DBI)
con <- dbConnect(RPostgreSQL::PostgreSQL(), dbname = "hadley")
dbListTables(con)


sctyner/dplyr050 documentation built on May 17, 2019, 2:22 p.m.