PostgreSQL:如何查看安装时的编译信息?

PostgreSQL 安装分为二进制包安装和编译安装方式,如果是编译安装,有时希望查看编译安装时的配置参数,例如编译安装时时设置的 WAL segsize 日志文件大小,或者 wal-blocksize 的大小,这些信息非常有用,这时可以使用pg_config查看。

查看编译信息

1
2
postgres@db> pg_config --configure
'--prefix=/opt/pgsql9.2.4' '--with-pgport=1921' '--with-perl' '--with-tcl' '--with-python' '--with-openssl' '--with-pam' '--without-ldap' '--with-libxml' '--with-libxslt' '--enable-thread-safety' 'with-wal-blocksize=16'

备注:更多选项参考 pg_config

附: pg_config 命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pg_config
Name
pg_config -- retrieve information about the installed version of PostgreSQL

Synopsis
pg_config [option...]

Description
The pg_config utility prints configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries.

Options
To use pg_config, supply one or more of the following options:

--bindir
...

参考

最后推荐和张文升共同编写的《PostgreSQL实战》,本书基于PostgreSQL 10 编写,共18章,重点介绍SQL高级特性、并行查询、分区表、物理复制、逻辑复制、备份恢复、高可用、性能优化、PostGIS等,涵盖大量实战用例!

购买链接:https://item.jd.com/12405774.html

PostgreSQL实战
感谢支持!
0%