Before the end of this year PostgreSQL version 10 will be released. In this post I will explain how you can already have a quick look at this new version by running it in a Docker container.
On my Github page you can find a docker-compose file with five defined containers: an ELK stack, pgAdmin and a PostgreSQL instance. The ELK stack will be used for collecting logs from the PostgreSQL instance. I am using a host machine running Ubuntu 16.04 with Docker version 17.05.0 and Docker Compose version 1.9.0. In the Kibana dashboard, you will be able to see an overview of all the SQL statements done by a pg_restore command, and look for any errors.
First step is to download the Github repository:
git clone -b v1.0 https://github.com/rudibroekhuizen/docker-postgresplus
Move to the docker-postgresplus folder and run the following command:
The containers will start. Start an interactive session to the Postgres container:
docker exec -it dockerpostgresplus_postgres_1 sh
Download Sakila example database:
wget https://s3.amazonaws.com/assets.datacamp.com/course/sql/dvdrental.zip; unzip dvdrental.zip
Create the Sakila database and import data:
su postgres psql psql> CREATE DATABASE sakila; /q pg_restore -U postgres -d sakila dvdrental.tar
Open the Kibana webinterface and import the dashboard.json file:
Now it is possible to see what and how many statements where issued by pg_restore and how long they took:
Open the pgAdmin webinterface to browse through all tables in the Sakila database:
Hostname, username and password are all set to “postgres”.