EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • All Courses
    • All Specializations
  • Blog
  • Enterprise
  • Free Courses
  • All Courses
  • All Specializations
  • Log in
  • Sign Up
Home Data Science Data Science Tutorials PostgreSQL Tutorial PostgreSQL show version
 

PostgreSQL show version

Updated May 22, 2023

PostgreSQL show version

 

 

Introduction to PostgreSQL shows the version.

PostgreSQL show version is used to show the currently installed version of PostgreSQL; multiple commands are available to show the version in PostgreSQL. The version will identify in two ways, i.e., major and minor, if suppose the currently installed version on the server is PostgreSQL 9.6 in that 9 is the major version, and 6 is the minor version. PostgreSQL releases the major version once a year; it will contain the major bug fixes and new features added.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

Syntax

Below is the syntax:

  • Select version();
  • # psql –V
  • # psql –version
  • SHOW server_version;
  • Psql –U [name of user] –W [password of user] –d [name of database] –c “select version();.”

Below is the parameter description syntax of the show version command.

  • Select version –This command shows the current version installed on the database. It will also show the major and minor version releases and the details of x86_64-pc-Linux-gnu, 64-bit, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39).
  • Show server_version() – It is used to show the currently installed version of the server.
  • Name of user –We can check the server version from the OS command line by connecting to the database; at that time, we used the user’s name.
  • Password of user –We need to use the user’s password at the time of the show version from the OS command line. If we have set the password authentication method as trust, then there is no need to use this parameter.
  • Name of database –This is defined as using the database name to connect to the database and show the version installed on the server. If we have used the user name the same as the database name, there is no need to use this parameter.

How to show the version in PostgreSQL?

  • The example below shows that we do not need to give the user any privileges; any user can see the currently installed version.
  • In the below first example, we have checked all user privileges; we have seen db_test user doesn’t have any privileges on the database server. So we are using the db_test user to show the current version of the database server.
  • After using this user, we can see the currently installed version on the database server.
  • It is possible to show the currently installed version of the database server without providing any grant to the user.
psql -U postgres –W
\du
psql -U db_test -d postgres –W
show server_version;
select version();

PostgreSQL show version output 1

Examples

Below is an example of the show version command.

1. Show the version by using the psql –V command 

  • The below example shows that the show version of the PostgreSQL database using the psql –V command is as follows.
  • We are using a capital V letter to show the currently installed version.
psql -V

PostgreSQL show version output 2

2. Show the version by using the psql –version command

The example below shows the PostgreSQL database’s show version using the psql –version command.

psql --version

PostgreSQL show version output 3

3. Show the version by connecting to the database server from the OS command line 

  • The below example shows the show version by connecting to the database server from the OS command line.
  • We have used the username, database name, and password of the user to check the version in PostgreSQL.
psql -U db_test -d postgres -W -c "show server_version;"
psql -U db_test -d postgres -W -c "select version();"

PostgreSQL show version output 4

4. Show the version by using the select version() command

  • The example below shows the show version database using the select version() command.
select version();

output 5

5. Show the version by using the showserver_version command 

  • The example below shows the show version of the PostgreSQL database using the show server_version command.
show server_version;

output 6

Recommended Articles

We hope that this EDUCBA information on “PostgreSQL show version” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

  1. PostgreSQL Compare Strings
  2. PostgreSQL EXCLUDE
  3. String Array in PostgreSQL
  4. PostgreSQL Import CSV
Primary Sidebar
Footer
Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

🚀 Limited Time Offer! - 🎁 ENROLL NOW