PostgreSQL / PostGIS

Mappin requires a PostgreSQL database server within which it will store its configuration. Mappin can also publish data from PostGIS tables.

If you would like to use an existing PostgreSQL database (which you have superuser access to) then skip the rest of this section.

We’ll now install the PostgreSQL database server and PostGIS spatial extension. This guide assumes you will be installing PostgreSQL / PostGIS on the same server that Mappin will be installed on. PostgreSQL / PostGIS may instead be installed on another server that’s network accessible from Mappin but that is not covered in this guide.

Obtaining Software

  1. Download the Windows x86-64 installer for PostgreSQL 10.x from the link below:

    https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

Installing

  1. Run the Windows x86-64 installer you downloaded in the previous step

  2. Click Next on the following screen:

    _images/pg_inst_01.png
  3. Optionally change your installation folder then click Next:

    _images/pg_inst_02.png
  4. Leave all components selected and click Next:

    _images/pg_inst_03.png
  5. Optionally, if you have a second physical disk on the server, it may be worth configuring PostgreSQL’s data directory to be on this drive. Click Next:

    _images/pg_inst_04.png
  6. Set a secure password for the postgres (super)user and keep it safe then click Next:

    _images/pg_inst_04a.png
  7. Leave the port as its default value but note it down if it’s not 5432. Click Next:

    _images/pg_inst_04b.png
  8. Leave the locale as its default value and click Next:

    _images/pg_inst_04c.png
  9. Check your install summary (yours may look different) and click Next:

    _images/pg_inst_05.png
  10. Click Next to start the installation:

_images/pg_inst_06.png

We’ll now try to use Stack Builder to download and install the PostGIS extension for us from the internet. If you do not have internet access, uncheck the Stack Builder option, click Finish and skip the rest of this section. Instead follow the next section: Installing PostGIS Manually.

  1. To attempt to use Stack Builder to download and install the PostGIS from the internet, click Finish:
_images/pg_inst_07.png
  1. Select your new PostgreSQL installation from the drop-down menu:
_images/pg_stack_01.png
  1. If you use a proxy server to access the internet, configure it here before clicking Next
  2. Select the latest PostGIS 2.4.x (64 bit) option from the Spatial Extensions section and click Next:
_images/pg_stack_02.png

If you cannot see PostGIS 2.4.x (64 bit) or cannot connect to the internet, cancel Stack Builder, skip the rest of this section and instead follow the next section: Installing PostGIS Manually.

  1. Click Next:
_images/pg_stack_03.png
  1. Click Next:
_images/pg_stack_04.png
  1. Follow the steps of the PostGIS installation using the following options:
  • Components to install: only PostGIS
  • Destination folder: default
  • Register GDAL_DATA: Yes
  • Set POSTGIS_ENABLED_DRIVERS: Yes
  • Enable out db rasters: Yes
  1. Installation should now be complete, click Finish:
_images/pg_stack_05.png

Installing PostGIS Manually

If you installed PostGIS successfully in the last section using Stack Builder then skip this section. This section describes how to install PostGIS manually if Stack Builder cannot connect to the internet.

  1. Download PostGIS from the link below:

    http://download.osgeo.org/postgis/windows/pg10/archive/postgis-bundle-pg10x64-setup-2.4.4-1.exe

  1. Run the downloaded file
  2. Follow the steps of the PostGIS installation using the following options:
  • Components to install: only PostGIS
  • Destination folder: default
  • Register GDAL_DATA: Yes
  • Set POSTGIS_ENABLED_DRIVERS: Yes
  • Enable out db rasters: Yes
  1. PostGIS has now been installed

Backups

It’s good practice to ensure your PostgreSQL / PostGIS database(s) are backed-up regularly (and essential if you will be storing working copies of datasets in PostgreSQL). This can be achieved with server-level backups / snapshots, filesystem-level backups or by other means (e.g. pg_dump). Implementing backups is a topic within itself and is not discussed in the Mappin documentation. Further advice / guidance on configuring backups for PostgreSQL can be obtained with one of our extended support packages. Contact us for more details.