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.
Why Check Versions?
-
Ensure compatibility with applications and extensions.
-
Verify support for specific features.
-
Troubleshoot errors related to outdated versions.
Steps to Determine PostgreSQL Version
Method 1: Using Command Line
-
Log in to your hosting account via SSH.
-
Run the following command:
Bash psql --versionExample output:
psql (PostgreSQL) 14.2
Method 2: Using SQL Query
-
Connect to PostgreSQL using
psql:Bash psql -U username dbname -
Run the query:
SELECT version();Example output:
PostgreSQL 14.2 on x86_64-pc-linux-gnu, compiled by gcc, 64-bit
Steps to Determine PostGIS Version
Method 1: Using SQL Query
-
Connect to your database with
psql. -
Run the query:
SELECT PostGIS_Version();Example output:
3.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Method 2: Using Extended Function
SELECT PostGIS_Full_Version();
This provides detailed information about PostGIS, GEOS, PROJ, and other libraries.
Important Notes
|