REQUEST COMPLIMENTARY SQLS*PLUS LICENCE
How to check the PostgreSQL version
Preamble
PostgreSQL, often referred to simply as Postgres, is a universal open-source object and relational database management system.
Knowing which version of the PostgreSQL server is installed and running in your system may be important in some situations. For example, if you are installing an application that requires a certain PostgreSQL version, you need to find out which version of your PostgreSQL server you are running.
In this article, we will explain how to find out which version of PostgreSQL server is running on your system.
PostgreSQL Version
PostgreSQL has versions in the following scheme:
MAJOR.MINOR
For example, in PostgreSQL 12.1 12 is the main version and 1 is the additional version.
- MAJOR – Starting with PostgreSQL 10, each new major release increases a part of the MAJOR version by one, for example by 10, 11, or 12. Prior to PostgreSQL 10, the major versions were represented by a decimal number, such as 9.0 or 9.6.
- MINOR – The minor release number is the last part of the version number. For example, 11.4 and 11.6 are minor versions, which are part of PostgreSQL version 11 9.6.15, and 9.6.16 are part of PostgreSQL version 9.6.
Major PostgreSQL releases with new features are usually released once a year. Each major release is supported for 5 years.
Command-line use
To find out which PostgreSQL version works on your system, call the Postgres command with the -version or -V parameter:
postgres --version
The command will print the PostgreSQL version:
postgres (PostgreSQL) 10.6
This example uses the PostgreSQL server version 10.6.
If the Postgres binary file is absent in the system PATH, you will get the error message “Postgres: command not found”. This usually happens when PostgreSQL package is not installed from standard distribution repositories.
You can find the path to the binary with the locate or find command:
sudo find /usr -wholename '*/bin/postgres'.
sudo updatedb
locate bin/postgres
The conclusion should look like this:
/usr/lib/postgresql/9.6/bin/postgres
Once you find the path to the binary file, you can use it to get a version of the PostgreSQL server:
/usr/lib/postgresql/9.6/bin/postgres -V
The version of the psql client utility in PostgreSQL can be found with the following command:
psql --version
The conclusion will look like this:
postgres (PostgreSQL) 10.6
psql is an interactive command-line utility that allows you to interact with the PostgreSQL server.
Using SQL shell
Another way to determine the version of the PostgreSQL server is to log in to the server SQL query and use the SQL instruction to print the version.
You can access the PostgreSQL shell using a GUI client such as pgAdmin or using psql:
sudo -u postgres psql
The following operator displays the PostgreSQL server version together with the build information:
SHOW server_version;
server_version
----------------
10.6
(1 row)
Conclusion
In this article, we showed you several different options on how to find the PostgreSQL server version running on your system.
Check PostgreSQL version
Enteros
About Enteros
Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of RDBMS, NoSQL, and machine learning database platforms.
MORE NEWS
PreambleNoSql is not a replacement for SQL databases but is a valid alternative for many situations where standard SQL is not the best approach for...
PreambleMongoDB Conditional operators specify a condition to which the value of the document field shall correspond.Comparison Query Operators $eq...
5 Database management trends impacting database administrationIn the realm of database management systems, moreover half (52%) of your competitors feel...
The data type is defined as the type of data that any column or variable can store in MS SQL Server. What is the data type? When you create any table or...
PreambleMS SQL Server is a client-server architecture. MS SQL Server process starts with the client application sending a query.SQL Server accepts,...
First the basics: what is the master/slave?One database server (“master”) responds and can do anything. A lot of other database servers store copies of all...
PreambleAtom Hopper (based on Apache Abdera) for those who may not know is an open-source project sponsored by Rackspace. Today we will figure out how to...
PreambleMongoDB recently introduced its new aggregation structure. This structure provides a simpler solution for calculating aggregated values rather...
FlexibilityOne of the most advertised features of MongoDB is its flexibility. Flexibility, however, is a double-edged sword. More flexibility means more...
PreambleSQLShell is a cross-platform command-line tool for SQL, similar to psql for PostgreSQL or MySQL command-line tool for MySQL.Why use it?If you...
PreambleWriting an application on top of the framework on top of the driver on top of the database is a bit like a game on the phone: you say “insert...
PreambleOracle Coherence is a distributed cache that is functionally comparable with Memcached. In addition to the basic function of the API cache, it...
PreambleIBM pureXML, a proprietary XML database built on a relational mechanism (designed for puns) that offers both relational ( SQL / XML ) and...
What is PostgreSQL array? In PostgreSQL we can define a column as an array of valid data types. The data type can be built-in, custom or enumerated....
PreambleIf you are a Linux sysadmin or developer, there comes a time when you need to manage an Oracle database that can work in your environment.In this...
PreambleStarting with Microsoft SQL Server 2008, by default, the group of local administrators is no longer added to SQL Server administrators during the...