PostgreSQL releases new versions on a regular basis. The major releases of Postgres are usually scheduled yearly and focus on fixing bugs and improving key features. In contrast, minor releases are scheduled nearly every three months. The minor releases focus on resolving the existing security issues.
Try the new PgManage (Open Source) and get rid of PgAdmin!
If you intend to implement new software, you might want to check if it is compatible with your Postgres version, whether the latest security patch is available, etc. In such cases, knowing which Postgres version is active on your system might be useful.
This blog post will teach you how to check the current version of Postgres running on your system via different interfaces. So, let’s get started!
Contact us today for all your Postgres and Open Source consulting and support needs.
How to Check/Get Postgres Version Using Command Prompt?
Follow the below-given stepwise guidelines to check the currently installed Postgres version on your system via the command prompt.
Step1: Access Bin Directory
Firstly, open the command prompt and run the following command to navigate to the Postgres bin folder:
cd C:\Program Files\PostgreSQL\14\bin

Hit the “Enter” button to access the desired directory/path:

The above snippet indicates the successful entry into the “bin” directory.
Step2: Check Postgres Version
Now execute the “psql -v” command to check the Postgres version:
psql -V

Alternatively, you can execute the “psql –version” command to find the Postgres version:
psql –version

The output shows that the “Postgres 14.4” version is running on your computer.
How to Check/Get Postgres Version Using SQL Shell?
Launch the SQL Shell, fill in the login details, and run the below command to check which version of Postgres is running on your machine:
SELECT VERSION();

Alternatively, you can utilize the following command to check the server version:
SHOW SERVER_VERSION;

The output proves that the specified command returns the Postgres version.
How to Check/Get Postgres Version Using pgAdmin?
To get the Postgres version via pgAdmin, users can follow the below-mentioned steps:
Step 1: Expand “Servers” Tree
Firstly, open the pgAdmin, specify the superuser password, and left-click on the “Servers” tree to expand it:

Step 2: Select Properties
Now, left-click on the “PostgreSQL” located under the “Servers” tree, and then click on the “Properties” tab:

Under the properties tab, you can check the currently installed Postgres Version on your system.
Conclusion
PostgreSQL releases new versions on a regular basis. To check which Postgres version is active on your system, users can run “psql –version” command from the command prompt, the “SELECT VERSION()” command from SQL Shell, or expand the “Servers” tree, left-click on “PostgreSQL” and then click on the properties tab to check the Postgres Version via pgAdmin. This blog post explained various approaches for checking the PostgreSQL version via practical demonstration.