pg_config

一个提供有关PostgreSQL构建方式信息的服务器实用程序

pg_config 是一个 服务器实用程序,提供有关已安装的 PostgreSQL 版本的构建方式的信息。

pg_config 添加于 PostgreSQL 7.1

用法

pg_config 列出当前安装的 PostgreSQL 版本的配置参数。默认情况下,所有参数都会被转储,但是可以使用相应的选项指定单个参数,例如 --bindir

PostgreSQL 9.6 开始,这些值也可以直接从同名视图 pg_config 中查询。

变更历史

示例

未指定任何选项时的 pg_config 输出示例

$ pg_config
BINDIR = /usr/local/pgsql/bin
DOCDIR = /usr/local/pgsql/share/doc
HTMLDIR = /usr/local/pgsql/share/doc
INCLUDEDIR = /usr/local/pgsql/include
PKGINCLUDEDIR = /usr/local/pgsql/include
INCLUDEDIR-SERVER = /usr/local/pgsql/include/server
LIBDIR = /usr/local/pgsql/lib
PKGLIBDIR = /usr/local/pgsql/lib
LOCALEDIR = /usr/local/pgsql/share/locale
MANDIR = /usr/local/pgsql/share/man
SHAREDIR = /usr/local/pgsql/share
SYSCONFDIR = /usr/local/pgsql/etc
PGXS = /usr/local/pgsql/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--prefix=/usr/local/pgsql'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
  -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3
  -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
  -Wno-format-truncation -O2
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lz -lreadline -lpthread -lrt -ldl -lm 
VERSION = PostgreSQL 14devel

指定单个选项

$ pg_config --bindir
/usr/local/pgsql/bin

指定多个选项

$ pg_config  --cc --version
gcc
PostgreSQL 14devel

分类

服务器实用程序

参见

pg_config (视图)

反馈

提交您对“pg_config”的任何评论、建议或更正 此处