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