随笔 - 256  文章 - 2  评论 - 18  阅读 - 123万

PostgreSQL中查看版本的几种方式

 

PostgreSQL中查看版本的几种方式

1、SQL方式

1
2
3
4
5
6
7
8
9
10
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方式

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

3、pg_controldata方式

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

4、查看告警日志

1
2
3
4
5
6
[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方式

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

 

转自:

http://www.zyiz.net/tech/detail-273823.html

posted on   腾逸  阅读(10227)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 我与微信审核的“相爱相杀”看个人小程序副业
· DeepSeek “源神”启动!「GitHub 热点速览」
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示