↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 命令行工具

pg_config

pg_config — retrieve information about the installed version of PostgreSQL

当前阅读 PG 18·选择有来源记录的版本

此版本暂无所选语言的定义,以下显示原始英文内容。

Documented executable
pg_config
Executable version
18.6
Reference inventory
Client applications
Option definition groups
24
environment
未知
manual path
app-pgconfig.html
signature
pg_config [ option ...]
synopsis
pg_config [ option ...]

版本定义 PG 18

pg_config

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

Print the location of user executables. Use this, for example, to find the psql program. This is normally also the location where the pg_config program resides.

--docdir

Print the location of documentation files.

--htmldir

Print the location of HTML documentation files.

--includedir

Print the location of C header files of the client interfaces.

--pkgincludedir

Print the location of other C header files.

--includedir-server

Print the location of C header files for server programming.

--libdir

Print the location of object code libraries.

--pkglibdir

Print the location of dynamically loadable modules, or where the server would search for them. (Other architecture-dependent data files might also be installed in this directory.)

--localedir

Print the location of locale support files. (This will be an empty string if locale support was not configured when PostgreSQL was built.)

--mandir

Print the location of manual pages.

--sharedir

Print the location of architecture-independent support files.

--sysconfdir

Print the location of system-wide configuration files.

--pgxs

Print the location of extension makefiles.

--configure

Print the options that were given to the configure script when PostgreSQL was configured for building. This can be used to reproduce the identical configuration, or to find out with what options a binary package was built. (Note however that binary packages often contain vendor-specific custom patches.) See also the examples below.

--cc

Print the value of the CC variable that was used for building PostgreSQL. This shows the C compiler used.

--cppflags

Print the value of the CPPFLAGS variable that was used for building PostgreSQL. This shows C compiler switches needed at preprocessing time (typically, -I switches).

--cflags

Print the value of the CFLAGS variable that was used for building PostgreSQL. This shows C compiler switches.

--cflags_sl

Print the value of the CFLAGS_SL variable that was used for building PostgreSQL. This shows extra C compiler switches used for building shared libraries.

--ldflags

Print the value of the LDFLAGS variable that was used for building PostgreSQL. This shows linker switches.

--ldflags_ex

Print the value of the LDFLAGS_EX variable that was used for building PostgreSQL. This shows linker switches used for building executables only.

--ldflags_sl

Print the value of the LDFLAGS_SL variable that was used for building PostgreSQL. This shows linker switches used for building shared libraries only.

--libs

Print the value of the LIBS variable that was used for building PostgreSQL. This normally contains -l switches for external libraries linked into PostgreSQL.

--version

Print the version of PostgreSQL.

-?
--help

Show help about pg_config command line arguments, and exit.

If more than one option is given, the information is printed in that order, one item per line. If no options are given, all available information is printed, with labels.

Notes

The options --docdir, --pkgincludedir, --localedir, --mandir, --sharedir, --sysconfdir, --cc, --cppflags, --cflags, --cflags_sl, --ldflags, --ldflags_sl, and --libs were added in PostgreSQL 8.1. The option --htmldir was added in PostgreSQL 8.4. The option --ldflags_ex was added in PostgreSQL 9.0.

Example

To reproduce the build configuration of the current PostgreSQL installation, run the following command:

eval ./configure `pg_config --configure`

The output of pg_config --configure contains shell quotation marks so arguments with spaces are represented correctly. Therefore, using eval is required for proper results.

Documented options

Option and argumentsDescription
--bindirPrint the location of user executables. Use this, for example, to find the psql program. This is normally also the location where the pg_config program resides.
--docdirPrint the location of documentation files.
--htmldirPrint the location of HTML documentation files.
--includedirPrint the location of C header files of the client interfaces.
--pkgincludedirPrint the location of other C header files.
--includedir-serverPrint the location of C header files for server programming.
--libdirPrint the location of object code libraries.
--pkglibdirPrint the location of dynamically loadable modules, or where the server would search for them. (Other architecture-dependent data files might also be installed in this directory.)
--localedirPrint the location of locale support files. (This will be an empty string if locale support was not configured when PostgreSQL was built.)
--mandirPrint the location of manual pages.
--sharedirPrint the location of architecture-independent support files.
--sysconfdirPrint the location of system-wide configuration files.
--pgxsPrint the location of extension makefiles.
--configurePrint the options that were given to the configure script when PostgreSQL was configured for building. This can be used to reproduce the identical configuration, or to find out with what options a binary package was built. (Note however that binary packages often contain vendor-specific custom patches.) See also the examples below.
--ccPrint the value of the CC variable that was used for building PostgreSQL . This shows the C compiler used.
--cppflagsPrint the value of the CPPFLAGS variable that was used for building PostgreSQL . This shows C compiler switches needed at preprocessing time (typically, -I switches).
--cflagsPrint the value of the CFLAGS variable that was used for building PostgreSQL . This shows C compiler switches.
--cflags_slPrint the value of the CFLAGS_SL variable that was used for building PostgreSQL . This shows extra C compiler switches used for building shared libraries.
--ldflagsPrint the value of the LDFLAGS variable that was used for building PostgreSQL . This shows linker switches.
--ldflags_exPrint the value of the LDFLAGS_EX variable that was used for building PostgreSQL . This shows linker switches used for building executables only.
--ldflags_slPrint the value of the LDFLAGS_SL variable that was used for building PostgreSQL . This shows linker switches used for building shared libraries only.
--libsPrint the value of the LIBS variable that was used for building PostgreSQL . This normally contains -l switches for external libraries linked into PostgreSQL .
--versionPrint the version of PostgreSQL .
-? --helpShow help about pg_config command line arguments, and exit.

比较版本

完整来源事实

options

map[description:Print the location of user executables. Use this, for example, to find the psql program. This is normally also the location where the pg_config program resides. names:[--bindir] signature:--bindir source_url:/docs/18/app-pgconfig.html summary:Print the location of user executables. Use this, for example, to find the psql program. This is normally also the location where the pg_config program resides.], map[description:Print the location of documentation files. names:[--docdir] signature:--docdir source_url:/docs/18/app-pgconfig.html summary:Print the location of documentation files.], map[description:Print the location of HTML documentation files. names:[--htmldir] signature:--htmldir source_url:/docs/18/app-pgconfig.html summary:Print the location of HTML documentation files.], map[description:Print the location of C header files of the client interfaces. names:[--includedir] signature:--includedir source_url:/docs/18/app-pgconfig.html summary:Print the location of C header files of the client interfaces.], map[description:Print the location of other C header files. names:[--pkgincludedir] signature:--pkgincludedir source_url:/docs/18/app-pgconfig.html summary:Print the location of other C header files.], map[description:Print the location of C header files for server programming. names:[--includedir-server] signature:--includedir-server source_url:/docs/18/app-pgconfig.html summary:Print the location of C header files for server programming.], map[description:Print the location of object code libraries. names:[--libdir] signature:--libdir source_url:/docs/18/app-pgconfig.html summary:Print the location of object code libraries.], map[description:Print the location of dynamically loadable modules, or where the server would search for them. (Other architecture-dependent data files might also be installed in this directory.) names:[--pkglibdir] signature:--pkglibdir source_url:/docs/18/app-pgconfig.html summary:Print the location of dynamically loadable modules, or where the server would search for them. (Other architecture-dependent data files might also be installed in this directory.)], map[description:Print the location of locale support files. (This will be an empty string if locale support was not configured when PostgreSQL was built.) names:[--localedir] signature:--localedir source_url:/docs/18/app-pgconfig.html summary:Print the location of locale support files. (This will be an empty string if locale support was not configured when PostgreSQL was built.)], map[description:Print the location of manual pages. names:[--mandir] signature:--mandir source_url:/docs/18/app-pgconfig.html summary:Print the location of manual pages.], map[description:Print the location of architecture-independent support files. names:[--sharedir] signature:--sharedir source_url:/docs/18/app-pgconfig.html summary:Print the location of architecture-independent support files.], map[description:Print the location of system-wide configuration files. names:[--sysconfdir] signature:--sysconfdir source_url:/docs/18/app-pgconfig.html summary:Print the location of system-wide configuration files.], map[description:Print the location of extension makefiles. names:[--pgxs] signature:--pgxs source_url:/docs/18/app-pgconfig.html summary:Print the location of extension makefiles.], map[description:Print the options that were given to the configure script when PostgreSQL was configured for building. This can be used to reproduce the identical configuration, or to find out with what options a binary package was built. (Note however that binary packages often contain vendor-specific custom patches.) See also the examples below. names:[--configure] signature:--configure source_url:/docs/18/app-pgconfig.html summary:Print the options that were given to the configure script when PostgreSQL was configured for building. This can be used to reproduce the identical configuration, or to find out with what options a binary package was built. (Note however that binary packages often contain vendor-specific custom patches.) See also the examples below.], map[description:Print the value of the CC variable that was used for building PostgreSQL . This shows the C compiler used. names:[--cc] signature:--cc source_url:/docs/18/app-pgconfig.html summary:Print the value of the CC variable that was used for building PostgreSQL . This shows the C compiler used.], map[description:Print the value of the CPPFLAGS variable that was used for building PostgreSQL . This shows C compiler switches needed at preprocessing time (typically, -I switches). names:[--cppflags] signature:--cppflags source_url:/docs/18/app-pgconfig.html summary:Print the value of the CPPFLAGS variable that was used for building PostgreSQL . This shows C compiler switches needed at preprocessing time (typically, -I switches).], map[description:Print the value of the CFLAGS variable that was used for building PostgreSQL . This shows C compiler switches. names:[--cflags] signature:--cflags source_url:/docs/18/app-pgconfig.html summary:Print the value of the CFLAGS variable that was used for building PostgreSQL . This shows C compiler switches.], map[description:Print the value of the CFLAGS_SL variable that was used for building PostgreSQL . This shows extra C compiler switches used for building shared libraries. names:[--cflags_sl] signature:--cflags_sl source_url:/docs/18/app-pgconfig.html summary:Print the value of the CFLAGS_SL variable that was used for building PostgreSQL . This shows extra C compiler switches used for building shared libraries.], map[description:Print the value of the LDFLAGS variable that was used for building PostgreSQL . This shows linker switches. names:[--ldflags] signature:--ldflags source_url:/docs/18/app-pgconfig.html summary:Print the value of the LDFLAGS variable that was used for building PostgreSQL . This shows linker switches.], map[description:Print the value of the LDFLAGS_EX variable that was used for building PostgreSQL . This shows linker switches used for building executables only. names:[--ldflags_ex] signature:--ldflags_ex source_url:/docs/18/app-pgconfig.html summary:Print the value of the LDFLAGS_EX variable that was used for building PostgreSQL . This shows linker switches used for building executables only.], map[description:Print the value of the LDFLAGS_SL variable that was used for building PostgreSQL . This shows linker switches used for building shared libraries only. names:[--ldflags_sl] signature:--ldflags_sl source_url:/docs/18/app-pgconfig.html summary:Print the value of the LDFLAGS_SL variable that was used for building PostgreSQL . This shows linker switches used for building shared libraries only.], map[description:Print the value of the LIBS variable that was used for building PostgreSQL . This normally contains -l switches for external libraries linked into PostgreSQL . names:[--libs] signature:--libs source_url:/docs/18/app-pgconfig.html summary:Print the value of the LIBS variable that was used for building PostgreSQL . This normally contains -l switches for external libraries linked into PostgreSQL .], map[description:Print the version of PostgreSQL . names:[--version] signature:--version source_url:/docs/18/app-pgconfig.html summary:Print the version of PostgreSQL .], map[description:Show help about pg_config command line arguments, and exit. names:[-? --help] signature:-? --help source_url:/docs/18/app-pgconfig.html summary:Show help about pg_config command line arguments, and exit.]

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8

正文语言: en · ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8