postgis_domains
postgis_domains · Define reusable PostGIS geometry and geography domains constrained to valid, simple SRID 4326 values
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100538 | postgis_domains | postgis_domains | 1.0 | GIS | MIT | SQL |
PostgreSQL · 10
| Relationships | |
|---|---|
| Requires | postgis |
Usage
Sources:
postgis_domains defines reusable PostGIS domains for common WGS 84 geometry and geography shapes. Use them when a schema should reject values with the wrong geometry family, dimensions, SRID, validity, or simplicity at the column boundary instead of repeating those checks in every table.
Core Workflow
PostGIS is a declared dependency, so installing this extension also requires postgis to be available. Choose the domain whose type and dimensional suffix match the intended data:
An input is accepted only if it satisfies the domain’s checks. This makes the constraint apply consistently to inserts, updates, casts, and every table that uses the domain.
Domain Families
The extension defines geometry and geography counterparts for point, multipoint, linestring, multilinestring, polygon, multipolygon, and general geometry values. The base two-dimensional form uses names such as point_geometry, linestring_geometry, and polygon_geography; m, z, and zm variants encode the required coordinate dimensions, for example pointz_geometry and polygonzm_geography.
The SQL definitions combine checks appropriate to each domain:
- the PostGIS object family must match the domain;
- the coordinate dimension must match the plain, M, Z, or ZM variant;
- the SRID must be 4326;
- the value must satisfy the extension’s validity and simplicity checks.
Inspect the exact installed definition before relying on a particular domain in generated DDL:
Operational Notes
Version 1.0 was developed with PostgreSQL 10 and PostGIS 2.5; the README only states that it should work with recent versions. That statement is not a tested compatibility matrix, so exercise the chosen domains against the exact PostgreSQL/PostGIS versions in production.
The control file declares postgis as a dependency, allows relocation, and does not require superuser installation or shared-library preload. Because domains participate in table column types, removing or replacing the extension requires addressing dependent columns first. All bundled domains enforce WGS 84 SRID 4326; transform source data explicitly rather than relabeling coordinates with a new SRID.