Version FunctionsThese functions report and upgrade PostGIS versions.
PostGIS_Extensions_Upgrade
Packages and upgrades PostGIS extensions (e.g. postgis_raster,
postgis_topology, postgis_sfcgal) to given or latest version.
text PostGIS_Extensions_Upgradetexttarget_version=nullDescriptionPackages and upgrades PostGIS extensions
to given or latest version. Only extensions you have installed in the
database will be packaged and upgraded if needed.
Reports full PostGIS version and build configuration infos after.
This is short-hand for doing multiple CREATE EXTENSION .. FROM
unpackaged and ALTER EXTENSION .. UPDATE for each PostGIS extension.
Currently only tries to upgrade extensions postgis,
postgis_raster, postgis_sfcgal, and postgis_topology.Availability: 2.5.0Changed: 3.4.0 to add target_version argument.Changed: 3.3.0 support for upgrades from any PostGIS version. Does not work on all systems.Changed: 3.0.0 to repackage loose extensions and support postgis_raster.ExamplesSELECT PostGIS_Extensions_Upgrade();
NOTICE: Packaging extension postgis
NOTICE: Packaging extension postgis_raster
NOTICE: Packaging extension postgis_sfcgal
NOTICE: Extension postgis_topology is not available or not packagable for some reasonSee Also,
,
,
,
,
PostGIS_Full_VersionReports full PostGIS version and build configuration
infos.text PostGIS_Full_VersionDescriptionReports full PostGIS version and build configuration
infos. Also informs about synchronization between
libraries and scripts suggesting upgrades as needed.Enhanced: 3.4.0 now includes extra PROJ configurations NETWORK_ENABLED, URL_ENDPOINT and DATABASE_PATH of proj.db location ExamplesSELECT PostGIS_Full_Version();POSTGIS="3.7.0dev 3.7.0alpha1-477-ga9004e778" [EXTENSION] PGSQL="180" GEOS="3.15.0beta1" SFCGAL="2.3.0" PROJ="9.8.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org DATABASE_PATH=/usr/share/proj/proj.db" GDAL="GDAL 3.13.1, released 2026/06/01" LIBXML="2.15.3"See Also,
,
,
,
,
,
PostGIS_GEOS_VersionReturns the version number of the GEOS
library.text PostGIS_GEOS_VersionDescriptionReturns the version number of the GEOS library, or
NULL if GEOS support is not enabled.ExamplesSELECT PostGIS_GEOS_Version();3.12.0dev-CAPI-1.18.0See Also, , , , PostGIS_GEOS_Compiled_VersionReturns the version number of the GEOS
library against which PostGIS was built.text PostGIS_GEOS_Compiled_VersionDescriptionReturns the version number of the GEOS library, or
against which PostGIS was built.Availability: 3.4.0ExamplesSELECT PostGIS_GEOS_Compiled_Version();3.12.0See Also,
PostGIS_Liblwgeom_VersionReturns the version number of the liblwgeom
library. This should match the version of PostGIS.text PostGIS_Liblwgeom_VersionDescriptionReturns the version number of the liblwgeom library/ExamplesSELECT PostGIS_Liblwgeom_Version();3.4.0dev 3.3.0rc2-993-g61bdf43a7See Also, , , , PostGIS_LibXML_VersionReturns the version number of the libxml2
library.text PostGIS_LibXML_VersionDescriptionReturns the version number of the LibXML2 library.Availability: 1.5ExamplesSELECT PostGIS_LibXML_Version();2.9.10See Also, , , , PostGIS_LibJSON_VersionReturns the version number of the libjson-c library.text PostGIS_LibJSON_VersionDescriptionReturns the version number of the LibJSON-C library.ExamplesSELECT PostGIS_LibJSON_Version();0.17See Also, , , , PostGIS_Lib_Build_DateReturns build date of the PostGIS library.text PostGIS_Lib_Build_DateDescriptionReturns build date of the PostGIS library.ExamplesSELECT PostGIS_Lib_Build_Date();2023-06-22 03:56:11PostGIS_Lib_VersionReturns the version number of the PostGIS
library.text PostGIS_Lib_VersionDescriptionReturns the version number of the PostGIS library.ExamplesSELECT PostGIS_Lib_Version();3.4.0devSee Also, , , , PostGIS_PROJ_VersionReturns the version number of the PROJ4
library.text PostGIS_PROJ_VersionDescriptionReturns the version number of the PROJ library and some configuration options of proj.Enhanced: 3.4.0 now includes NETWORK_ENABLED, URL_ENDPOINT and DATABASE_PATH of proj.db location ExamplesSELECT PostGIS_PROJ_Version();7.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.dbSee Also,
,
,
,
,
PostGIS_PROJ_Compiled_VersionReturns the version number of the PROJ
library against which PostGIS was built.text PostGIS_PROJ_Compiled_VersionDescriptionReturns the version number of the PROJ library, or
against which PostGIS was built.Availability: 3.5.0ExamplesSELECT PostGIS_PROJ_Compiled_Version();9.1.1See Also,
PostGIS_Wagyu_VersionReturns the version number of the internal Wagyu library.text PostGIS_Wagyu_VersionDescriptionReturns the version number of the internal Wagyu library, or
NULL if Wagyu support is not enabled.ExamplesSELECT PostGIS_Wagyu_Version();0.5.0 (Internal)See Also, , , , , PostGIS_Scripts_Build_DateReturns build date of the PostGIS scripts.text PostGIS_Scripts_Build_DateDescriptionReturns build date of the PostGIS scripts.Availability: 1.0.0RC1ExamplesSELECT PostGIS_Scripts_Build_Date();2023-06-22 03:56:11See Also, , , , PostGIS_Scripts_InstalledReturns version of the PostGIS scripts installed in this
database.text PostGIS_Scripts_InstalledDescriptionReturns version of the PostGIS scripts installed in this
database.If the output of this function doesn't match the output of
you probably missed to properly upgrade an existing database.
See the Upgrading section for
more info.Availability: 0.9.0ExamplesSELECT PostGIS_Scripts_Installed();3.4.0dev 3.3.0rc2-993-g61bdf43a7See Also, , PostGIS_Scripts_ReleasedReturns the version number of the postgis.sql script
released with the installed PostGIS lib.text PostGIS_Scripts_ReleasedDescriptionReturns the version number of the postgis.sql script
released with the installed PostGIS lib.Starting with version 1.1.0 this function returns the same
value of . Kept
for backward compatibility.Availability: 0.9.0ExamplesSELECT PostGIS_Scripts_Released();3.4.0dev 3.3.0rc2-993-g61bdf43a7See Also, , PostGIS_VersionReturns PostGIS version number and compile-time
options.text PostGIS_VersionDescriptionReturns PostGIS version number and compile-time options.ExamplesSELECT PostGIS_Version();3.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1See Also, , , ,