Skip to content

Determining the PostgreSQL and PostGIS versions

When working with PostgreSQL and PostGIS, it’s important to know which versions are installed on your hosting account. On ruachost.com, you can check these versions directly from the command line or within SQL queries.

  • Ensure compatibility with applications and extensions.
  • Verify support for specific features.
  • Troubleshoot errors related to outdated versions.
  1. Log in to your hosting account via SSH.

  2. Run the following command:

    Terminal window
    psql --version

    Example output:

    psql (PostgreSQL) 14.2
  1. Connect to PostgreSQL using psql:

    Terminal window
    psql -U username dbname
  2. Run the query:

    SELECT version();

    Example output:

    PostgreSQL 14.2 on x86_64-pc-linux-gnu, compiled by gcc, 64-bit
  1. Connect to your database with psql.

  2. Run the query:

    SELECT PostGIS_Version();

    Example output:

    3.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
SELECT PostGIS_Full_Version();

This provides detailed information about PostGIS, GEOS, PROJ, and other libraries.