postgis
postgis
postgis : PostGIS geometry and geography spatial types and functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 1500 | postgis
|
postgis
|
3.6.3 |
GIS
|
GPL-2.0
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d--
|
No
|
Yes
|
No
|
Yes
|
no
|
no
|
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG
|
3.6.3 |
18
17
16
15
14
|
postgis |
- |
| RPM | PGDG
|
3.6.3 |
18
17
16
15
14
|
postgis36_$v |
- |
| DEB | PGDG
|
3.6.3 |
18
17
16
15
14
|
postgresql-$v-postgis-3 |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
el8.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
el9.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
el9.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
el10.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
el10.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
d12.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
d12.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
d13.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
d13.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
u22.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
u22.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
u24.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
u24.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
u26.x86_64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
u26.aarch64
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
PGDG 3.6.3
|
Source
Install
Make sure PGDG repo available:
pig repo add pgdg -u # add pgdg repo and update cacheInstall this extension with pig:
pig install postgis; # install via package name, for the active PG version
pig install postgis -v 18; # install for PG 18
pig install postgis -v 17; # install for PG 17
pig install postgis -v 16; # install for PG 16
pig install postgis -v 15; # install for PG 15
pig install postgis -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION postgis;Usage
Source: Official manual, current manual HTML, release notes, patch release announcement
postgis adds spatial types, indexes, and SQL functions to PostgreSQL. The main user-facing split is between geometry for planar/projected work and geography for spherical calculations on longitude/latitude data.
Basic setup
CREATE EXTENSION postgis;
SELECT PostGIS_Full_Version();Core types and functions
CREATE TABLE sensors (
id bigserial PRIMARY KEY,
geom geometry(Point, 4326),
geog geography(Point, 4326)
);
SELECT ST_SetSRID(ST_MakePoint(-73.985, 40.748), 4326);
SELECT ST_Intersects(a.geom, b.geom) FROM a, b;
SELECT ST_DWithin(a.geom, b.geom, 100);
SELECT ST_Distance(a.geog, b.geog);
SELECT ST_Transform(geom, 3857) FROM sensors;- constructors:
ST_MakePoint,ST_GeomFromText,ST_GeomFromGeoJSON - relationships:
ST_Intersects,ST_Contains,ST_Within,ST_DWithin - measurements and transforms:
ST_Distance,ST_Area,ST_Length,ST_Transform - processing:
ST_Buffer,ST_Intersection,ST_Union
Spatial indexes
CREATE INDEX idx_sensors_geom ON sensors USING GIST (geom);The official manual continues to recommend GiST as the general-purpose spatial index, with BRIN and SP-GiST available for specific data distributions and tradeoffs.
Caveats
- Use
geometryin an appropriate projected SRID for planar distances and areas; usegeographywhen you need meter-based spheroidal calculations. PostGIS 3.6.3is a patch release dated 2026-04-14. The release notes describe fixes and a security hardening change, not a new stub-level usage surface, so this refresh mostly trims and aligns the stub with the current manual.
Last updated on