Determining the PostgreSQL and PostGIS versions

Learn how to determine which versions of PostgreSQL and PostGIS are installed on a server using the psql command-line program.

This article describes how to determine which PostgreSQL and PostGIS versions are installed on a server.

Determining the PostgreSQL version

To determine which PostgreSQL version is installed on your server, log in to your account using SSH, and then type the following command at the command line:

psql --version

Alternatively, you can log in to PostgreSQL from the command line using the psql program, and then type the following query to view additional version information:

SELECT version();

Determining the PostGIS version

Your server may also have PostGIS installed. To determine the version installed on your server, log in to PostgreSQL from the command line using the psql program, and then type the following query:

SELECT PostGIS_full_version();

If PostGIS is installed, you see output that resembles the following (the exact version numbers may differ):

POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" 
GDAL="GDAL 1.9.1, released 2012/05/15 GDAL_DATA not found" LIBXML="2.7.6" TOPOLOGY RASTER
(1 row)

If PostGIS is not installed, however, you see output that resembles the following:

ERROR:  function postgis_full_version() does not exist

📘

Note

If you have a managed VPS or managed Dedicated server and would like PostGIS installed, please open a support ticket at https://my.hosting.com.

Related Articles