These functions report and upgrade PostGIS versions.

# Version Functions

PostGIS_Extensions_Upgrade

Packages and upgrades PostGIS extensions (e.g. postgis_raster, postgis_topology, postgis_sfcgal) to latest available version.

    			text PostGIS_Extensions_Upgrade

### Description

Packages and upgrades PostGIS extensions to 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, postgis_topology, and postgis_tiger_geocoder.

Availability: 2.5.0

Changed: 3.0.0 to repackage loose extensions and support postgis_raster.

### Examples

    SELECT 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 reason
    NOTICE:  Extension postgis_tiger_geocoder is not available or not packagable for some reason

                        postgis_extensions_upgrade
    -------------------------------------------------------------------
     Upgrade completed, run SELECT postgis_full_version(); for details
    (1 row)

### See Also

upgrading, PostGIS_GEOS_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_PROJ_Version, PostGIS_Version

PostGIS_Full_Version

Reports full PostGIS version and build configuration infos.

    			text PostGIS_Full_Version

### Description

Reports full PostGIS version and build configuration infos. Also informs about synchronization between libraries and scripts suggesting upgrades as needed.

### Examples

    SELECT PostGIS_Full_Version();
    							   postgis_full_version
    ----------------------------------------------------------------------------------
    POSTGIS="3.0.0dev r17211" [EXTENSION] PGSQL="110" GEOS="3.8.0dev-CAPI-1.11.0 df24b6bb" SFCGAL="1.3.6" PROJ="Rel. 5.2.0, September 15th, 2018"
    GDAL="GDAL 2.3.2, released 2018/09/21" LIBXML="2.9.9" LIBJSON="0.13.1" LIBPROTOBUF="1.3.1" WAGYU="0.4.3 (Internal)" TOPOLOGY RASTER
    (1 row)

### See Also

upgrading, PostGIS_GEOS_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_PROJ_Version, PostGIS_Wagyu_Version, PostGIS_Version

PostGIS_GEOS_Version

Returns the version number of the GEOS library.

    			text PostGIS_GEOS_Version

### Description

Returns the version number of the GEOS library, or `NULL` if GEOS support is not enabled.

### Examples

    SELECT PostGIS_GEOS_Version();
     postgis_geos_version
    ----------------------
     3.1.0-CAPI-1.5.0
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_PROJ_Version, PostGIS_Version

PostGIS_Liblwgeom_Version

Returns the version number of the liblwgeom library. This should match the version of PostGIS.

    			text PostGIS_Liblwgeom_Version

### Description

Returns the version number of the liblwgeom library/

### Examples

    SELECT PostGIS_Liblwgeom_Version();
    postgis_liblwgeom_version
    --------------------------
    2.3.3 r15473
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_PROJ_Version, PostGIS_Version

PostGIS_LibXML_Version

Returns the version number of the libxml2 library.

    			text PostGIS_LibXML_Version

### Description

Returns the version number of the LibXML2 library.

Availability: 1.5

### Examples

    SELECT PostGIS_LibXML_Version();
     postgis_libxml_version
    ----------------------
     2.7.6
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_Lib_Version, PostGIS_PROJ_Version, PostGIS_GEOS_Version, PostGIS_Version

PostGIS_Lib_Build_Date

Returns build date of the PostGIS library.

    			text PostGIS_Lib_Build_Date

### Description

Returns build date of the PostGIS library.

### Examples

    SELECT PostGIS_Lib_Build_Date();
     postgis_lib_build_date
    ------------------------
     2008-06-21 17:53:21
    (1 row)

PostGIS_Lib_Version

Returns the version number of the PostGIS library.

    			text PostGIS_Lib_Version

### Description

Returns the version number of the PostGIS library.

### Examples

    SELECT PostGIS_Lib_Version();
     postgis_lib_version
    ---------------------
     1.3.3
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_GEOS_Version, PostGIS_LibXML_Version, PostGIS_PROJ_Version, PostGIS_Version

PostGIS_PROJ_Version

Returns the version number of the PROJ4 library.

    			text PostGIS_PROJ_Version

### Description

Returns the version number of the PROJ4 library, or `NULL` if PROJ4 support is not enabled.

### Examples

    SELECT PostGIS_PROJ_Version();
      postgis_proj_version
    -------------------------
     Rel. 4.4.9, 29 Oct 2004
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_GEOS_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_Version

PostGIS_Wagyu_Version

Returns the version number of the internal Wagyu library.

    			text PostGIS_Wagyu_Version

### Description

Returns the version number of the internal Wagyu library, or `NULL` if Wagyu support is not enabled.

### Examples

    SELECT PostGIS_Wagyu_Version();
     postgis_wagyu_version
    -----------------------
     0.4.3 (Internal)
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_GEOS_Version, PostGIS_PROJ_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_Version

PostGIS_Scripts_Build_Date

Returns build date of the PostGIS scripts.

    			text PostGIS_Scripts_Build_Date

### Description

Returns build date of the PostGIS scripts.

Availability: 1.0.0RC1

### Examples

    SELECT PostGIS_Scripts_Build_Date();
      postgis_scripts_build_date
    -------------------------
     2007-08-18 09:09:26
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_GEOS_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_Version

PostGIS_Scripts_Installed

Returns version of the PostGIS scripts installed in this database.

    			text PostGIS_Scripts_Installed

### Description

Returns version of the PostGIS scripts installed in this database.

If the output of this function doesn't match the output of PostGIS_Scripts_Released you probably missed to properly upgrade an existing database. See the Upgrading section for more info.

Availability: 0.9.0

### Examples

    SELECT PostGIS_Scripts_Installed();
      postgis_scripts_installed
    -------------------------
     1.5.0SVN
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_Scripts_Released, PostGIS_Version

PostGIS_Scripts_Released

Returns the version number of the postgis.sql script released with the installed PostGIS lib.

    			text PostGIS_Scripts_Released

### Description

Returns 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 PostGIS_Lib_Version. Kept for backward compatibility.

Availability: 0.9.0

### Examples

    SELECT PostGIS_Scripts_Released();
      postgis_scripts_released
    -------------------------
     1.3.4SVN
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_Scripts_Installed, PostGIS_Lib_Version

PostGIS_Version

Returns PostGIS version number and compile-time options.

    			text PostGIS_Version

### Description

Returns PostGIS version number and compile-time options.

### Examples

    SELECT PostGIS_Version();
    			postgis_version
    ---------------------------------------
     1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
    (1 row)

### See Also

PostGIS_Full_Version, PostGIS_GEOS_Version, PostGIS_Lib_Version, PostGIS_LibXML_Version, PostGIS_PROJ_Version