PostgreSQL: Which version of PostgreSQL am I running?

后端 未结 16 920
迷失自我
迷失自我 2020-12-02 03:22

I\'m in a corporate environment (running Debian Linux) and didn\'t install it myself. I access the databases using Navicat or phpPgAdmin (if that helps). I also don\'t have

16条回答
  •  孤街浪徒
    2020-12-02 03:53

    Don’t know how reliable this is, but you can get two tokens of version fully automatically:

    psql --version 2>&1 | tail -1 | awk '{print $3}' | sed 's/\./ /g' | awk '{print $1 "." $2}'
    

    So you can build paths to binaries:

    /usr/lib/postgresql/9.2/bin/postgres
    

    Just replace 9.2 with this command.

提交回复
热议问题