Dear all,
I lately undertook an effort to create an R-Script that loads the current (Autumn 2018) version of PATSTAT global into a PostgreSQL database. It
- Creates all necessary tables (very close to the suggestion to be found in the PATSTAT SQL script)
- unzips the PATSTAT downloads one-by-one and load them into RAM
- Writes them into the corresponding database tables
- Sets all primary and foreign keys
- Defines a couple of (what I believe to be usefull) indicies
- Clusters the tables by their primary keys (not implemented yet).
The implementation in R has a couple of advantages>
- It facilitates the database setup for analysts which are not necessary used to the initial configuration of databases
- The optimized R ´fread´ function loads the tables way faster than the SQl native WRITE TABLE
It can be found here:
https://github.com/daniel-hain/PATSTAT-PostgreSQL
Comments and suggestions are always welcome. Hope it proves helpful for some.
Best
Daniel
R script for loading PATSTAT global (Autumn Edition 2018) into PostgreSQL
-
- Posts: 1
- Joined: Wed Jan 30, 2019 10:45 am
R script for loading PATSTAT global (Autumn Edition 2018) into PostgreSQL
Last edited by daniel_hain on Thu Jan 31, 2019 9:46 am, edited 1 time in total.
-
- Posts: 426
- Joined: Thu Feb 22, 2007 5:33 pm
- Contact:
Re: R script for loading PATSTAT global (Autumn Edition 2018) into PostgreSQL
Hello Daniel,
many thanks for sharing your work with the community.
Geert BOEDT
many thanks for sharing your work with the community.
Geert BOEDT
PATSTAT Support Team
EPO - Vienna
patstat @ epo.org
EPO - Vienna
patstat @ epo.org