[Ilugc] Finding Postgresql version number

  • From: metherid@xxxxxxxxx (Rahul Sundaram)
  • Date: Sat, 5 Feb 2011 20:18:48 +0530

2011/2/5 ??? ?????? <vrpcse at gmail.com>

Hi friends,

   I want to get the version number of postgresql installed in a system.
"psql --version" serves the purpose, but it prints the version number with
some text information also. I want only the version number. Is there any
way
to get only the version number or i have to process the "psql --version"
output ?


Depending on the use case, processing the package version information might
be easier.   RPM or any mainstream package manager would have options to
return the version information and only that.

Rahul

Other related posts: