
上QQ阅读APP看书,第一时间看更新
How to do it…
We will find out the version by directly querying the database server:
- Connect to the database and issue the following command:
postgres # SELECT version();
- You'll get a response that looks something like this:
PostgreSQL 11.2 on x86_64-apple-darwin16.7.0,
compiled by Apple LLVM version 9.0.0 (clang-900.0.39.2), 64-bit
That's probably too much information all at once!
Some other ways of checking the version number are as follows:
bash # psql --version
psql (PostgreSQL) 11.2
However, be wary that this shows the client software version number, which may differ from the server software version number. You should check the server version directly by using the following command:
bash # cat $PGDATA/PG_VERSION
Here, you must set PGDATA to the actual data directory. Refer to the Locating the database server files recipe for more information.
Notice that the preceding command does not show the maintenance release number.