PostgreSQL: Which version of PostgreSQL am I running?

后端 未结 16 743
迷失自我
迷失自我 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:50

    For the current version of PgAdmin: 4.16 at the time of writing.

    1. Select the DB whose version you need.
    2. Click on the properties tab in the right pane.

    See screenshot below:

    0 讨论(0)
  • 2020-12-02 03:51

    Run this query from PostgreSQL:

    SELECT version();
    
    0 讨论(0)
  • 2020-12-02 03:52

    If Select version() returns with Memo try using the command this way:

    Select version::char(100) 
    

    or

    Select version::varchar(100)
    
    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-02 03:54

    in shell psql.exe , execute

    \! psql -V
    
    0 讨论(0)
  • 2020-12-02 03:54

    Using pgadmin4 it can be seen by double clicking Servers > server_name_here > Properties tab > Version:

    Version 3.5:

    Version 4.1, 4.5:

    0 讨论(0)
提交回复
热议问题