How to determine the PostgreSQL and PostGIS versions

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
If you have a managed VPS or managed Dedicated server and would like PostGIS installed, please open a support ticket on the Customer Portal at https://my.a2hosting.com.

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.