PostgreSQL

Install

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

brew install postgresql
export PGDATA=~/db/postgres-9.5 # set this globally somewhere
initdb -E utf8
createdb
createdb hadley
createdb test
createdb lahman
createdb nycflights13

Start

pg_ctl start

Connect

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


Try the dbplyr package in your browser

Any scripts or data that you put into this service are public.

dbplyr documentation built on Oct. 26, 2023, 9:06 a.m.