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 fully managed PostgreSQL cloud solution, designed for reliability and performance:

  • Unlimited connections and data transfers for effortless scalability.
  • PgAdmin web interface included for easy database management.
  • Popular extensions included, such as PostGIS, TimescaleDB, and PgVector.
  • Simple, one-click updates to keep your database secure and up to date.
  • High performance and enhanced security on private, dedicated infrastructure.

Save time and make your life easier: 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!