An open source database management system based on C, PostgreSQL, was developed in 1996 by the University of California, Berkeley. PostgreSQL continues to update the database version at regular time intervals. Its main edition is published once a year and focuses on fixing known bugs, adding new features, and improving them. It is essential to know the version of PostgreSQL installed on your system, both as a database administrator and as a system administrator. Its minor version comes at least every three months to address ongoing security concerns.
PostgreSQL
major version
Previously, its major version was represented as a decimal number, for example, 9.6 or 9.0. After PostgreSQL 10, the core part of the release increased by a number for major release versions, for example, 10, 11, 12, etc.
PostgreSQL minor version The
last part number in the release displays the minor version number. For example, 10.4 or 10.6 are minor versions of PostgreSQL version 10. In the past, PostgreSQL version 13.3 has been available for installation. We will explore different methods to check PostgreSQL version in this tutorial.
How to check
PostgreSQL
version
You can check PostgreSQL version in several ways. Here, we will understand all the methods and see how you can check the PostgreSQL version on your system.
Check
the version of PostgreSQL using the command line
You can check the current version of PostgreSQL running on your system with the help of the command line. You can do this by accessing the terminal and running the following command:
Or
you can run any of the above commands and check the PostgreSQL version. Both commands will provide you with the same output.
You get a “Postgres
: Command not found” error if the Postgres binary is not present in the path to the file system. Let’s fix this problem by searching the PostgreSQL binary directory. Run the following command in a terminal window
:
With this command, you can see the full path to the PostgreSQL binary folder in your terminal. Type the full path to find out which
version of PostgreSQL you have:
Or Both
commands will provide you with the same output
. Check the PostgreSQL version
by using SQL Shell
You can retrieve the PostgreSQL version through the PostgreSQL command prompt. PostgreSQL versions are displayed on the post-login screen after logging into the PostgreSQL server via the terminal.
The server must log in to the SQL prompt and get its output by running the SQL command.
Through Parameters
You can check the PostgreSQL version by preset parameter. Automatic version checking is also possible using the following method:
Through
the version() function
When executing version(), you can also determine the PostgreSQL version. You can also check the PostgreSQL version in the automation script.
Check the version of PostgreSQL
PSQL client version
In addition to being a PostgreSQL client, psql is also a terminal-based command-line utility. Psql gives users access to PostgreSQL databases. The version information of the psql client utility can be found using the following command:
OR The
above commands will provide you with the same output for anyone to use
.
Postgres version in
pgAdmin4
The pgAdmin4 web interface is a great way to manage PostgreSQL servers. The web interface displays the version of Postgres for pgAdmin4 users. To find
out the version of PostgreSQL, follow these steps:
- Log in to pgAdmin4
- Select your Postgres server by expanding the servers in the left sidebar
- Now, go to the properties tab
- The last step is to check the PostgreSQL version in the general section.
.
.
.
Conclusion
In this tutorial, we have discussed several methods to check PostgreSQL version and see how easy it is to check each version. We hope that through this article, you have understood all the methods and learned how to check the PostgreSQL version by each method. Check out the other Linux tips articles for more tips and tutorials.