pg_config 是一个系统目录视图,用于描述当前PostgreSQL实例的编译时配置参数。
pg_config 在PostgreSQL 9.6中添加。
用法
pg_config 以可通过SQL查询的形式提供pg_config实用程序的输出。
请注意,pg_config的未过滤输出似乎具有可预测的顺序,即与pg_config实用程序的输出相同。
按 PostgreSQL 版本定义
pg_config (PostgreSQL 13)
View "pg_catalog.pg_config"
Column | Type | Collation | Nullable | Default
---------+------+-----------+----------+---------
name | text | | |
setting | text | | |
文档:pg_config
pg_config (PostgreSQL 12)
View "pg_catalog.pg_config"
Column | Type | Collation | Nullable | Default
---------+------+-----------+----------+---------
name | text | | |
setting | text | | |
文档:pg_config
pg_config (PostgreSQL 11)
View "pg_catalog.pg_config"
Column | Type | Collation | Nullable | Default
---------+------+-----------+----------+---------
name | text | | |
setting | text | | |
文档:pg_config
pg_config (PostgreSQL 10)
View "pg_catalog.pg_config"
Column | Type | Collation | Nullable | Default
---------+------+-----------+----------+---------
name | text | | |
setting | text | | |
文档:pg_config
pg_config (PostgreSQL 9.6)
View "pg_catalog.pg_config"
Column | Type | Modifiers
---------+------+-----------
name | text |
setting | text |
文档:pg_config
变更历史
- PostgreSQL 12
- 底层函数的行为从
immutable更改为stable(提交290e3b77)
- 底层函数的行为从
- PostgreSQL 9.6
- 添加(提交a5c43b88)
示例
postgres=# SELECT * FROM pg_config;
name | setting
-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BINDIR | /home/pguser/postgres/builds/96/bin
DOCDIR | /home/pguser/postgres/builds/96/share/doc
HTMLDIR | /home/pguser/postgres/builds/96/share/doc
INCLUDEDIR | /home/pguser/postgres/builds/96/include
PKGINCLUDEDIR | /home/pguser/postgres/builds/96/include
INCLUDEDIR-SERVER | /home/pguser/postgres/builds/96/include/server
LIBDIR | /home/pguser/postgres/builds/96/lib
PKGLIBDIR | /home/pguser/postgres/builds/96/lib
LOCALEDIR | /home/pguser/postgres/builds/96/share/locale
MANDIR | /home/pguser/postgres/builds/96/share/man
SHAREDIR | /home/pguser/postgres/builds/96/share
SYSCONFDIR | /home/pguser/postgres/builds/96/etc
PGXS | /home/pguser/postgres/builds/96/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE | '--prefix=/home/pguser/postgres/builds/96' 'LDFLAGS=-L/opt/local/lib'
CC | gcc
CPPFLAGS | -DFRONTEND
CFLAGS | -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2
CFLAGS_SL |
LDFLAGS | -L../../src/common -L/opt/local/lib -Wl,-dead_strip_dylibs
LDFLAGS_EX |
LDFLAGS_SL |
LIBS | -lpgcommon -lpgport -lz -lreadline -lm
VERSION | PostgreSQL 9.6.6
(23 rows)
参考资料
- PostgreSQL文档: pg_config
