Prepare the open source relational database with geospatial support to receive IoT and RTLS data from Pareto Anywhere.
Learn how to install the pair for IoT and RTLS applications with Pareto Anywhere.
Pareto Anywhere open source IoT middleware installed.
Install the pair on a specific operating system.
Follow the instructions specific to your operating system to install PostgreSQL:
Open a terminal and then:
sudo apt update
sudo apt upgrade
sudo apt install postgresql
<1 min The installed PostgreSQL version will depend on your OS version (ex: postgresql-16 on Ubuntu 24.10).
Download the latest PostgreSQL version from EDB and follow the installer instructions.
The default installer settings should apply to common use cases.
Again, follow the instructions specific to your operating system to install PostGIS:
Open a terminal and then install PostGIS with the command sudo apt install postgresql-postgis
<1 min
The installed PostGIS version will depend on your OS version (ex: postgresql-16-postgis-3 on Ubuntu 24.10).
Run the StackBuilder program provided by the PostgreSQL installation, select the Spatial Extensions / PostGIS option and complete the installation.
The default installer settings should apply to common use cases.
Now that PostgreSQL and PostGIS are installed, it is possible to create a database with the PostGIS extension, which is covered in Step 2 below.
Create the database with PostGIS extension.
Open a terminal and then log in to PostgreSQL as the postgres user with the command sudo -u postgres psql
Once logged in, the terminal prompt should change to postgres=#, accepting database queries. Enter the following queries:
CREATE USER reelyactive WITH ENCRYPTED PASSWORD 'paretoanywhere';
CREATE DATABASE pareto_anywhere WITH OWNER reelyactive;
This will create a database called pareto_anywhere owned by user reelyactive with password paretoanywhere.
Remain logged in as the postgres user and change to the pareto_anywhere database with the following command:
\c pareto_anywhere
Then enter the following queries:
CREATE EXTENSION postgis;
SELECT postgis_full_version();
This will create the PostGIS extension on the pareto_anywhere database. The second query simply verifies the PostGIS version number.*
* ERROR: function postgis_full_version() does not exist would indicate that creation of the PostGIS extension was unsuccessful.
Now that the database is created, it is possible to create tables in which data to write the IoT and RTLS data, which is covered in Step 3 below.
Create the database tables and indexes.
See Creating tables and Creating indexes in the barnacles-postgres documentation.
Tutorial prepared with ♥ by jeffyactive.
You can reelyActive's open source efforts directly by contributing code & docs, collectively by sharing across your network, and commercially through our packages.Continue exploring our open architecture and all its applications.