PostgreSQL Databases: Connect To R and Python

Michael Grogan
4 min readFeb 22, 2019

PostgreSQL is a commonly used database language for creating and managing large amounts of data effectively.

Here, you will see how to:

  1. create a PostgreSQL database using the Linux terminal
  2. connect the PostgreSQL database to R using the “RpostgreSQL” library, and to Python using the “psycopg2” library

Creating our PostgreSQL database

In this example, we are going to create a simple database containing a table of dates, cities, and…

--

--

Michael Grogan

Statistical Data Scientist | Python and R trainer | Financial Writer | michael-grogan.com