PostGISSpatial Reference System

postgis_srs_all

What is postgis_srs_all?

postgis_srs_all returns a row for every SRS PROJ knows about, including authority, code, name, and bounds. Available from PostGIS 3.4.

SQL
postgis_srs_all() → SETOF record

Useful for populating lookup tables, search interfaces, or CSV exports that document all supported CRSs on the current PROJ installation.

When would you use postgis_srs_all?

Use postgis_srs_all to seed a cache table of supported CRSs for self-service GIS tooling, or to diff between two PROJ installations to detect CRS database drift.

It is also useful when building an internal CRS picker whose options should always reflect what the installed PROJ library actually supports, rather than the static spatial_ref_sys snapshot shipped with PostGIS.

FAQs

How many SRSs does it return?

Several thousand — PROJ's EPSG database alone contains over 7,000 entries.

Is it fast?

The function iterates the PROJ database. Running it repeatedly is wasteful; cache the output for application use.

Does it include deprecated CRSs?

Yes. The returned row includes a deprecated flag you can filter on.

What version introduced it?

PostGIS 3.4.