How can I link a Google spreadsheet to PostgreSQL?

google-docs, postgresql

Solution

My approach is using R and its googlesheets and DBI libraries. Googlesheets connects the spreadsheet with R and DBI connects the R with PostgreSQL. You can update the table whenever you want by simply running the script. With this approach you can also add transformations to the data before storing them in PostgreSQL. Another way is using Python and pandas and gspread libraries.

More info: Googlesheets: https://cran.r-project.org/web/packages/googlesheets/vignettes/basic-usage.html

DBI: https://cran.r-project.org/web/packages/DBI/vignettes/DBI-1.html

Problem

How can I link a Google spreadsheet to PostgreSQL? I googled and got some sample code for MySQL, and a couple of products which do it. As per this link ,support exists for a few databases.

Original source