PostgreSQL: Activating PostgreSQL PostGIS Extension

This documentation is part of the Getting Started guide. You can view the complete guide here: How to Get Started with PostgreSQL.

👋 Welcome to the Stackhero documentation!

Stackhero offers a ready-to-use PostgreSQL cloud solution that provides a host of benefits, including:

  • Unlimited connections and data transfers.
  • PgAdmin web UI included.
  • Many modules included like PostGIS, TimescaleDB, and PgVector.
  • Effortless updates with just a click.
  • Optimal performance and robust security powered by a private and dedicated VM.

Save time and simplify your life: it only takes 5 minutes to try Stackhero's PostgreSQL cloud hosting solution!

The PostGIS extension is included with our PostgreSQL service. You must activate it on each database where you plan to use it.

To activate the extension, connect to your database and execute this query:

CREATE EXTENSION postgis;

You can verify that PostGIS is working by checking its version:

SELECT PostGIS_Full_Version();

Alternatively, retrieve a list of all installed PostGIS extensions:

SELECT * FROM pg_extension WHERE extname LIKE 'postgis%';

If necessary, you may add other extensions. However, it is strongly recommended that you do not activate extensions that you will not use:

-- Enable PostGIS
CREATE EXTENSION postgis;

-- Enable raster support
CREATE EXTENSION postgis_raster;

-- Enable Topology
CREATE EXTENSION postgis_topology;

-- Fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;

-- Rule based standardizer
CREATE EXTENSION address_standardizer;

-- Example rule data set
CREATE EXTENSION address_standardizer_data_us;

-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;

Caution: do not activate PostGIS on the database postgres!