Skip to content

Instantly share code, notes, and snippets.

@daattali
Created November 15, 2017 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daattali/49e808affe7496fa8a04434e79b86453 to your computer and use it in GitHub Desktop.
Save daattali/49e808affe7496fa8a04434e79b86453 to your computer and use it in GitHub Desktop.
# Connecting using RPostgreSQL works
library(RPostgreSQL)
con <- dbConnect(dbDriver("PostgreSQL"),
host = "localhost",
dbname = "postgres",
user = "postgres",
password = password,
port = 5432)
# Connecting with odbc not working (probably wrong parameters)
con <- DBI::dbConnect(odbc::odbc(),
Driver = "PostgreSQL Driver",
Server = "localhost",
Database = "postgres",
UID = 'postgres',
PWD = password,
Port = 5432)
# Error: nanodbc/nanodbc.cpp:950: IM002: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment