Storing data using PostgreSQL
In this recipe we store our planet data in PostgreSQL. PostgreSQL is an open source relational database management system (RDBMS). It is developed by a worldwide team of volunteers, is not controlled by any corporation or other private entity, and the source code is available free of charge. It has a lot of unique features such as hierarchical data models.
Getting ready
First make sure you have access to a PostgreSQL data instance. Again, you can install one locally, run one in a container, or get an instance in the cloud.
As with MySQL, we need to first create a database. The process is almost identical to that of MySQL but with slightly different commands and parameters.
- From the terminal execute the psql command at the terminal. This takes you into the psql command processor:
# psql -U postgres psql (9.6.4) Type "help" for help. postgres=#
- Now create the scraping database:
postgres=# create database scraping; CREATE DATABASE postgres=#
- Then switch to the new...