我在一个企业环境中(运行Debian Linux),没有自己安装它。我使用Navicat或phpPgAdmin访问数据库(如果有帮助的话)。我也没有运行数据库的服务器的shell访问权。
当前回答
我相信这就是你要找的,
服务器版本:
pg_config --version
客户端版本:
psql --version
其他回答
在撰写本文时,适用于PgAdmin的当前版本:4.16。
选择需要版本的DB服务器。 单击其中的属性选项卡 右边的窗格。
请看下面的截图:
如果Select version()返回Memo,尝试这样使用命令:
Select version::char(100)
or
Select version::varchar(100)
执行命令
psql -V
在哪里
V必须大写。
使用命令行 服务器:
postgres -V
客户:
psql -V
登录postgres,然后:
postgres=# select version();
或者来自cli:
psql -c "SELECT version();"
使用VERSION特殊变量 以postgres用户登录:
sudo su - postgres
然后:
psql -c "\echo :VERSION"
请查看这里的指南以获得完整的解释
使用pgadmin4,双击Servers > server_name_here > Properties选项卡> Version:
3.5版本:
4.1、4.5版本: