数据库
首页 > 数据库> > PostgreSQL中查看版本的几种方式

PostgreSQL中查看版本的几种方式

作者:互联网

PostgreSQL中查看版本的几种方式

1、SQL方式

postgres=# show server_version;
 server_version 
----------------
 13.2
(1 row)
postgres=# select version();
                                                 version                                                 
---------------------------------------------------------------------------------------------------------
 PostgreSQL 13.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
(1 row)

2、pg_config方式

[pg13@mambapg ~]$  pg_config|grep VERSION
VERSION = PostgreSQL 13.2

3、pg_controldata方式

[pg13@mambapg ~]$ pg_controldata --version
pg_controldata (PostgreSQL) 13.2

4、查看告警日志

[pg13@mambapg pg_log]$ pwd
/pg13/pgdata/pg_log
[pg13@mambapg pg_log]$ more postgresql-Mon.log|grep "LOG:  starting PostgreSQL"
2021-04-26 17:06:52.654 CST [10990] LOG:  starting PostgreSQL 13.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2021-04-26 17:33:48.605 CST [15580] LOG:  starting PostgreSQL 13.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2021-04-26 17:36:32.401 CST [15968] LOG:  starting PostgreSQL 13.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit

5、postgres方式

[pg13@mambapg pg_log]$ postgres --version
postgres (PostgreSQL) 13.2

标签:PostgreSQL,4.8,几种,version,64,pg,版本,13.2
来源: https://blog.csdn.net/weixin_49756466/article/details/122051712