{"Entry":{"collection":"tool","key":"pg-config","name":"pg_config","aliases":["pg_config"],"metadata":{"aliases":["pg_config"],"category":"Client applications","content_hash":"1669c42c2bcf003f2b628a460a60800c63614b075186cee5f0281271f679b711","derived_content_hash":"0df290c2d93be9655e03fabc429617c0465286ccdb937c1e9aeb3e89bd2df5b9","imported_at":"2026-09-30T00:40:34.111991+08:00","name":"pg_config","name_zh":"","slug":"pg-config","summary":"pg_config — retrieve information about the installed version of PostgreSQL"}},"Definition":{"Collection":"tool","Key":"pg-config","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"pg-config","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[],"options":[{"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"},{"description":"Print the location of documentation files.","names":["--docdir"],"signature":"--docdir"},{"description":"Print the location of HTML documentation files.","names":["--htmldir"],"signature":"--htmldir"},{"description":"Print the location of C header files of the client interfaces.","names":["--includedir"],"signature":"--includedir"},{"description":"Print the location of other C header files.","names":["--pkgincludedir"],"signature":"--pkgincludedir"},{"description":"Print the location of C header files for server programming.","names":["--includedir-server"],"signature":"--includedir-server"},{"description":"Print the location of object code libraries.","names":["--libdir"],"signature":"--libdir"},{"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"},{"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"},{"description":"Print the location of manual pages.","names":["--mandir"],"signature":"--mandir"},{"description":"Print the location of architecture-independent support files.","names":["--sharedir"],"signature":"--sharedir"},{"description":"Print the location of system-wide configuration files.","names":["--sysconfdir"],"signature":"--sysconfdir"},{"description":"Print the location of extension makefiles.","names":["--pgxs"],"signature":"--pgxs"},{"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"},{"description":"Print the value of the CC variable that was used for building PostgreSQL . This shows the C compiler used.","names":["--cc"],"signature":"--cc"},{"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"},{"description":"Print the value of the CFLAGS variable that was used for building PostgreSQL . This shows C compiler switches.","names":["--cflags"],"signature":"--cflags"},{"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"},{"description":"Print the value of the LDFLAGS variable that was used for building PostgreSQL . This shows linker switches.","names":["--ldflags"],"signature":"--ldflags"},{"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"},{"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"},{"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"},{"description":"Print the version of PostgreSQL .","names":["--version"],"signature":"--version"},{"description":"Show help about pg_config command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"}],"synopsis":["pg_config [ option ...]"]},"comparison_hash":"248cccc5a7ef651b001ba3bc1551a93a9ce4d99191053e610269d49e7daa3cb5","description":["pg_config — retrieve information about the installed version of PostgreSQL"],"description_zh":"描述 pg_config 工具打印当前已安装的 PostgreSQL 版本的配置参数。例如，希望与 PostgreSQL 对接的软件包可以使用它，以便找到所需的头文件和库。 选项 要使用 pg_config ，请提供下列一个或多个选项： --bindir 打印用户可执行文件所在的位置。例如，可用它来查找 psql 程序。通常这也是 pg_config 程序所在的位置。 --docdir 打印文档文件所在的位置。 --htmldir 打印 HTML 文档文件所在的位置。 --includedir 打印客户端接口的 C 头文件所在的位置。 --pkgincludedir 打印其他 C 头文件所在的位置。 --includedir-server 打印服务器编程所用 C 头文件所在的位置。 --libdir 打印目标代码库所在的位置。 --pkglibdir 打印动态可加载模块所在的位置，或服务器将搜索这些模块的位置。（其他与体系结构相关的数据文件也可能安装在该目录中。） --localedir 打印区域设置支持文件所在的位置。（如果在构建 PostgreSQL 时未配置区域设置支持，则这将是一个空字符串。） --mandir 打印手册页所在的位置。 --sharedir 打印与体系结构无关的支持文件所在的位置。 --sysconfdir 打印系统范围的配置文件所在的位置。 --pgxs 打印扩展 makefile 的位置。 --configure 打印为构建 PostgreSQL 而运行 configure 脚本时给定的选项。这可用于重现完全相同的配置，或者查明某个二进制软件包是用哪些选项构建的。（但请注意，二进制软件包通常包含供应商特定的自定义补丁。）另请参见下面的示例。 --cc 打印构建 PostgreSQL 时所用的 CC 变量值。这显示所使用的 C 编译器。 --cppflags 打印构建 PostgreSQL 时所用的 CPPFLAGS 变量值。这显示预处理阶段所需的 C 编译器开关（通常是 -I 开关）。 --cflags 打印构建 PostgreSQL 时所用","description_zh_html":"\u003cp\u003e命令行工具 pg_config [ option ...]。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003epg_config\u003c/span\u003e 工具打印当前已安装的 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 版本的配置参数。例如，希望与 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 对接的软件包可以使用它，以便找到所需的头文件和库。\n  \u003c/p\u003e\u003c/div\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e选项\u003c/h2\u003e\u003cp\u003e\n   要使用 \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e，请提供下列一个或多个选项：\n   \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--bindir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印用户可执行文件所在的位置。例如，可用它来查找 \u003ccode class=\"command\"\u003epsql\u003c/code\u003e 程序。通常这也是 \u003ccode class=\"filename\"\u003epg_config\u003c/code\u003e 程序所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--docdir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印文档文件所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--htmldir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印 HTML 文档文件所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--includedir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印客户端接口的 C 头文件所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pkgincludedir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印其他 C 头文件所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--includedir-server\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印服务器编程所用 C 头文件所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--libdir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印目标代码库所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pkglibdir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印动态可加载模块所在的位置，或服务器将搜索这些模块的位置。（其他与体系结构相关的数据文件也可能安装在该目录中。）\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--localedir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印区域设置支持文件所在的位置。（如果在构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时未配置区域设置支持，则这将是一个空字符串。）\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--mandir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印手册页所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sharedir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印与体系结构无关的支持文件所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sysconfdir\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印系统范围的配置文件所在的位置。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgxs\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印扩展 makefile 的位置。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--configure\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印为构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 而运行 \u003ccode class=\"filename\"\u003econfigure\u003c/code\u003e 脚本时给定的选项。这可用于重现完全相同的配置，或者查明某个二进制软件包是用哪些选项构建的。（但请注意，二进制软件包通常包含供应商特定的自定义补丁。）另请参见下面的示例。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cc\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eCC\u003c/code\u003e 变量值。这显示所使用的 C 编译器。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cppflags\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eCPPFLAGS\u003c/code\u003e 变量值。这显示预处理阶段所需的 C 编译器开关（通常是 \u003ccode class=\"literal\"\u003e-I\u003c/code\u003e 开关）。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cflags\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eCFLAGS\u003c/code\u003e 变量值。这显示 C 编译器开关。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cflags_sl\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eCFLAGS_SL\u003c/code\u003e 变量值。这显示构建共享库时使用的额外 C 编译器开关。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eLDFLAGS\u003c/code\u003e 变量值。这显示链接器开关。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags_ex\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eLDFLAGS_EX\u003c/code\u003e 变量值。这显示仅用于构建可执行文件的链接器开关。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags_sl\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eLDFLAGS_SL\u003c/code\u003e 变量值。这显示仅用于构建共享库的链接器开关。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--libs\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印构建 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 时所用的 \u003ccode class=\"varname\"\u003eLIBS\u003c/code\u003e 变量值。这通常包含外部库的 \u003ccode class=\"literal\"\u003e-l\u003c/code\u003e 开关，这些外部库会被链接进 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 的版本。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        显示有关 \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e 命令行参数的帮助，然后退出。\n       \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\n   如果给出了多个选项，信息会按给出的顺序输出，每行一项。如果未给出任何选项，则会输出所有可用信息，并带有标签。\n  \u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/app-pgconfig.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","environment":[],"facts":[{"label":"Documented executable","value":"pg_config"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Client applications"},{"label":"Option definition groups","value":"24"}],"facts_zh":[{"label":"手册中的可执行程序","value":"pg_config"},{"label":"程序版本","value":"18.6"},{"label":"参考清单","value":"客户端程序"},{"label":"选项定义组","value":"24"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGCONFIG\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_config\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_config — retrieve information about the installed version of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.13.4.1\"\u003e\u003ccode class=\"command\"\u003epg_config\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003eThe \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e utility prints configuration parameters of the currently installed version of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. It is intended, for example, to be used by software packages that want to interface to \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e to facilitate finding the required header files and libraries.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eTo use \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e, supply one or more of the following options:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--bindir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of user executables. Use this, for example, to find the \u003ccode class=\"command\"\u003epsql\u003c/code\u003e program. This is normally also the location where the \u003ccode class=\"filename\"\u003epg_config\u003c/code\u003e program resides.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--docdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of documentation files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--htmldir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of HTML documentation files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--includedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of C header files of the client interfaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pkgincludedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of other C header files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--includedir-server\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of C header files for server programming.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--libdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of object code libraries.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pkglibdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint 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.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--localedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of locale support files. (This will be an empty string if locale support was not configured when \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e was built.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--mandir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of manual pages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sharedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of architecture-independent support files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sysconfdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of system-wide configuration files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgxs\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of extension makefiles.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--configure\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the options that were given to the \u003ccode class=\"filename\"\u003econfigure\u003c/code\u003e script when \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cc\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCC\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows the C compiler used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cppflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCPPFLAGS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows C compiler switches needed at preprocessing time (typically, \u003ccode class=\"literal\"\u003e-I\u003c/code\u003e switches).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCFLAGS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows C compiler switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cflags_sl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCFLAGS_SL\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows extra C compiler switches used for building shared libraries.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLDFLAGS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows linker switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags_ex\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLDFLAGS_EX\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows linker switches used for building executables only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags_sl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLDFLAGS_SL\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows linker switches used for building shared libraries only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--libs\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLIBS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This normally contains \u003ccode class=\"literal\"\u003e-l\u003c/code\u003e switches for external libraries linked into \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the version of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eIf 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.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.7\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eThe options \u003ccode class=\"option\"\u003e--docdir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--pkgincludedir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--localedir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--mandir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--sharedir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--sysconfdir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cc\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cppflags\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cflags\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cflags_sl\u003c/code\u003e, \u003ccode class=\"option\"\u003e--ldflags\u003c/code\u003e, \u003ccode class=\"option\"\u003e--ldflags_sl\u003c/code\u003e, and \u003ccode class=\"option\"\u003e--libs\u003c/code\u003e were added in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.1. The option \u003ccode class=\"option\"\u003e--htmldir\u003c/code\u003e was added in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.4. The option \u003ccode class=\"option\"\u003e--ldflags_ex\u003c/code\u003e was added in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 9.0.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.8\"\u003e\n\u003ch2\u003eExample\u003c/h2\u003e\n\u003cp\u003eTo reproduce the build configuration of the current PostgreSQL installation, run the following command:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eeval ./configure `pg_config --configure`\n\u003c/pre\u003e\n\u003cp\u003eThe output of \u003ccode class=\"literal\"\u003epg_config --configure\u003c/code\u003e contains shell quotation marks so arguments with spaces are represented correctly. Therefore, using \u003ccode class=\"literal\"\u003eeval\u003c/code\u003e is required for proper results.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-pgconfig.html","options":[{"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."},{"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."},{"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."},{"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."},{"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."},{"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."},{"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."},{"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.)"},{"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.)"},{"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."},{"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."},{"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."},{"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."},{"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."},{"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."},{"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)."},{"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."},{"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."},{"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."},{"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."},{"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."},{"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 ."},{"description":"Print the version of PostgreSQL .","names":["--version"],"signature":"--version","source_url":"/docs/18/app-pgconfig.html","summary":"Print the version of PostgreSQL ."},{"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."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"sections_zh":[],"signature":"pg_config [ option ...]","sources":[{"anchor":"","file":"app-pgconfig.html","label":"18.6 English manual · app-pgconfig.html","sha256":"db15302f0536178ed6b93e98108702c73f6b9d4797ab02cedc991ede12e511d6","url":"/docs/18/app-pgconfig.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}],"synopsis":["pg_config [ option ...]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"--bindir","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."},{"signature":{"text":"--docdir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of documentation files."},{"signature":{"text":"--htmldir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of HTML documentation files."},{"signature":{"text":"--includedir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of C header files of the client interfaces."},{"signature":{"text":"--pkgincludedir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of other C header files."},{"signature":{"text":"--includedir-server","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of C header files for server programming."},{"signature":{"text":"--libdir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of object code libraries."},{"signature":{"text":"--pkglibdir","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.)"},{"signature":{"text":"--localedir","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.)"},{"signature":{"text":"--mandir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of manual pages."},{"signature":{"text":"--sharedir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of architecture-independent support files."},{"signature":{"text":"--sysconfdir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of system-wide configuration files."},{"signature":{"text":"--pgxs","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of extension makefiles."},{"signature":{"text":"--configure","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."},{"signature":{"text":"--cc","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."},{"signature":{"text":"--cppflags","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)."},{"signature":{"text":"--cflags","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."},{"signature":{"text":"--cflags_sl","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."},{"signature":{"text":"--ldflags","url":"/docs/18/app-pgconfig.html"},"summary":"Print the value of the LDFLAGS variable that was used for building PostgreSQL . This shows linker switches."},{"signature":{"text":"--ldflags_ex","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."},{"signature":{"text":"--ldflags_sl","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."},{"signature":{"text":"--libs","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 ."},{"signature":{"text":"--version","url":"/docs/18/app-pgconfig.html"},"summary":"Print the version of PostgreSQL ."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgconfig.html"},"summary":"Show help about pg_config command line arguments, and exit."}],"title":"Documented options"}],"tables_zh":[{"columns":[{"key":"signature","label":"选项与参数"},{"key":"summary","label":"说明"}],"key":"options","rows":[{"signature":{"text":"--bindir","url":"/docs/18/app-pgconfig.html"},"summary":"打印用户可执行文件所在的位置。例如，可用它来查找 psql 程序。通常这也是 pg_config 程序所在的位置。"},{"signature":{"text":"--docdir","url":"/docs/18/app-pgconfig.html"},"summary":"打印文档文件所在的位置。"},{"signature":{"text":"--htmldir","url":"/docs/18/app-pgconfig.html"},"summary":"打印 HTML 文档文件所在的位置。"},{"signature":{"text":"--includedir","url":"/docs/18/app-pgconfig.html"},"summary":"打印客户端接口的 C 头文件所在的位置。"},{"signature":{"text":"--pkgincludedir","url":"/docs/18/app-pgconfig.html"},"summary":"打印其他 C 头文件所在的位置。"},{"signature":{"text":"--includedir-server","url":"/docs/18/app-pgconfig.html"},"summary":"打印服务器编程所用 C 头文件所在的位置。"},{"signature":{"text":"--libdir","url":"/docs/18/app-pgconfig.html"},"summary":"打印目标代码库所在的位置。"},{"signature":{"text":"--pkglibdir","url":"/docs/18/app-pgconfig.html"},"summary":"打印动态可加载模块所在的位置，或服务器将搜索这些模块的位置。（其他与体系结构相关的数据文件也可能安装在该目录中。）"},{"signature":{"text":"--localedir","url":"/docs/18/app-pgconfig.html"},"summary":"打印区域设置支持文件所在的位置。（如果在构建 PostgreSQL 时未配置区域设置支持，则这将是一个空字符串。）"},{"signature":{"text":"--mandir","url":"/docs/18/app-pgconfig.html"},"summary":"打印手册页所在的位置。"},{"signature":{"text":"--sharedir","url":"/docs/18/app-pgconfig.html"},"summary":"打印与体系结构无关的支持文件所在的位置。"},{"signature":{"text":"--sysconfdir","url":"/docs/18/app-pgconfig.html"},"summary":"打印系统范围的配置文件所在的位置。"},{"signature":{"text":"--pgxs","url":"/docs/18/app-pgconfig.html"},"summary":"打印扩展 makefile 的位置。"},{"signature":{"text":"--configure","url":"/docs/18/app-pgconfig.html"},"summary":"打印为构建 PostgreSQL 而运行 configure 脚本时给定的选项。这可用于重现完全相同的配置，或者查明某个二进制软件包是用哪些选项构建的。（但请注意，二进制软件包通常包含供应商特定的自定义补丁。）另请参见下面的示例。"},{"signature":{"text":"--cc","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 CC 变量值。这显示所使用的 C 编译器。"},{"signature":{"text":"--cppflags","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 CPPFLAGS 变量值。这显示预处理阶段所需的 C 编译器开关（通常是 -I 开关）。"},{"signature":{"text":"--cflags","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 CFLAGS 变量值。这显示 C 编译器开关。"},{"signature":{"text":"--cflags_sl","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 CFLAGS_SL 变量值。这显示构建共享库时使用的额外 C 编译器开关。"},{"signature":{"text":"--ldflags","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 LDFLAGS 变量值。这显示链接器开关。"},{"signature":{"text":"--ldflags_ex","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 LDFLAGS_EX 变量值。这显示仅用于构建可执行文件的链接器开关。"},{"signature":{"text":"--ldflags_sl","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 LDFLAGS_SL 变量值。这显示仅用于构建共享库的链接器开关。"},{"signature":{"text":"--libs","url":"/docs/18/app-pgconfig.html"},"summary":"打印构建 PostgreSQL 时所用的 LIBS 变量值。这通常包含外部库的 -l 开关，这些外部库会被链接进 PostgreSQL 。"},{"signature":{"text":"--version","url":"/docs/18/app-pgconfig.html"},"summary":"打印 PostgreSQL 的版本。"},{"signature":{"text":"-? --help","url":"/docs/18/app-pgconfig.html"},"summary":"显示有关 pg_config 命令行参数的帮助，然后退出。"}],"title":"手册中的选项"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"f34ab8fbacb0c5d1d28f984bad997270fdea3e3f64189d476d05fa303262af62","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"command-description-and-options","fragment_sha256":"cf46adf3497a685889d149faa9c1d1becc2ce249469c820a5ab8c6cce338cf19","locale":"zh-Hans","page_key":"app-pgconfig.html","source_hash":"4e293ae77c27d0b90c0dd9d3c264c16c64c6cfd861be95809f4c95a1b92c64e5","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/app-pgconfig.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8"}},"ManualEvidence":{"manual_path":"app-pgconfig.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-pgconfig.html","label":"18.6 English manual · app-pgconfig.html","sha256":"db15302f0536178ed6b93e98108702c73f6b9d4797ab02cedc991ede12e511d6","url":"/docs/18/app-pgconfig.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"pg-config","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_config","Summary":"pg_config — retrieve information about the installed version of PostgreSQL","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-PGCONFIG\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epg_config\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_config — retrieve information about the installed version of \u003cspan\u003ePostgreSQL\u003c/span\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.13.4.1\"\u003e\u003ccode\u003epg_config\u003c/code\u003e [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.13.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003eThe \u003cspan\u003epg_config\u003c/span\u003e utility prints configuration parameters of the currently installed version of \u003cspan\u003ePostgreSQL\u003c/span\u003e. It is intended, for example, to be used by software packages that want to interface to \u003cspan\u003ePostgreSQL\u003c/span\u003e to facilitate finding the required header files and libraries.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.13.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eTo use \u003cspan\u003epg_config\u003c/span\u003e, supply one or more of the following options:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--bindir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of user executables. Use this, for example, to find the \u003ccode\u003epsql\u003c/code\u003e program. This is normally also the location where the \u003ccode\u003epg_config\u003c/code\u003e program resides.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--docdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of documentation files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--htmldir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of HTML documentation files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--includedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of C header files of the client interfaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--pkgincludedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of other C header files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--includedir-server\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of C header files for server programming.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--libdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of object code libraries.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--pkglibdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint 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.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--localedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of locale support files. (This will be an empty string if locale support was not configured when \u003cspan\u003ePostgreSQL\u003c/span\u003e was built.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--mandir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of manual pages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--sharedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of architecture-independent support files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--sysconfdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of system-wide configuration files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--pgxs\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of extension makefiles.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--configure\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the options that were given to the \u003ccode\u003econfigure\u003c/code\u003e script when \u003cspan\u003ePostgreSQL\u003c/span\u003e 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--cc\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eCC\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This shows the C compiler used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--cppflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eCPPFLAGS\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This shows C compiler switches needed at preprocessing time (typically, \u003ccode\u003e-I\u003c/code\u003e switches).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--cflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eCFLAGS\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This shows C compiler switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--cflags_sl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eCFLAGS_SL\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This shows extra C compiler switches used for building shared libraries.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--ldflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eLDFLAGS\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This shows linker switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--ldflags_ex\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eLDFLAGS_EX\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This shows linker switches used for building executables only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--ldflags_sl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eLDFLAGS_SL\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This shows linker switches used for building shared libraries only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--libs\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode\u003eLIBS\u003c/code\u003e variable that was used for building \u003cspan\u003ePostgreSQL\u003c/span\u003e. This normally contains \u003ccode\u003e-l\u003c/code\u003e switches for external libraries linked into \u003cspan\u003ePostgreSQL\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the version of \u003cspan\u003ePostgreSQL\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003epg_config\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eIf 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.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.13.7\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eThe options \u003ccode\u003e--docdir\u003c/code\u003e, \u003ccode\u003e--pkgincludedir\u003c/code\u003e, \u003ccode\u003e--localedir\u003c/code\u003e, \u003ccode\u003e--mandir\u003c/code\u003e, \u003ccode\u003e--sharedir\u003c/code\u003e, \u003ccode\u003e--sysconfdir\u003c/code\u003e, \u003ccode\u003e--cc\u003c/code\u003e, \u003ccode\u003e--cppflags\u003c/code\u003e, \u003ccode\u003e--cflags\u003c/code\u003e, \u003ccode\u003e--cflags_sl\u003c/code\u003e, \u003ccode\u003e--ldflags\u003c/code\u003e, \u003ccode\u003e--ldflags_sl\u003c/code\u003e, and \u003ccode\u003e--libs\u003c/code\u003e were added in \u003cspan\u003ePostgreSQL\u003c/span\u003e 8.1. The option \u003ccode\u003e--htmldir\u003c/code\u003e was added in \u003cspan\u003ePostgreSQL\u003c/span\u003e 8.4. The option \u003ccode\u003e--ldflags_ex\u003c/code\u003e was added in \u003cspan\u003ePostgreSQL\u003c/span\u003e 9.0.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.13.8\"\u003e\n\u003ch2\u003eExample\u003c/h2\u003e\n\u003cp\u003eTo reproduce the build configuration of the current PostgreSQL installation, run the following command:\u003c/p\u003e\n\u003cpre\u003eeval ./configure `pg_config --configure`\n\u003c/pre\u003e\n\u003cp\u003eThe output of \u003ccode\u003epg_config --configure\u003c/code\u003e contains shell quotation marks so arguments with spaces are represented correctly. Therefore, using \u003ccode\u003eeval\u003c/code\u003e is required for proper results.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"70b9a7b8a3da28c63c81a67d9461a1ab5fbcadfc16a3e3c512a65dfc2e5c7e5c","Payload":{"description":["pg_config — retrieve information about the installed version of PostgreSQL"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGCONFIG\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_config\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_config — retrieve information about the installed version of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.13.4.1\"\u003e\u003ccode class=\"command\"\u003epg_config\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003eThe \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e utility prints configuration parameters of the currently installed version of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. It is intended, for example, to be used by software packages that want to interface to \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e to facilitate finding the required header files and libraries.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eTo use \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e, supply one or more of the following options:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--bindir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of user executables. Use this, for example, to find the \u003ccode class=\"command\"\u003epsql\u003c/code\u003e program. This is normally also the location where the \u003ccode class=\"filename\"\u003epg_config\u003c/code\u003e program resides.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--docdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of documentation files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--htmldir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of HTML documentation files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--includedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of C header files of the client interfaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pkgincludedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of other C header files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--includedir-server\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of C header files for server programming.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--libdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of object code libraries.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pkglibdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint 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.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--localedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of locale support files. (This will be an empty string if locale support was not configured when \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e was built.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--mandir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of manual pages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sharedir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of architecture-independent support files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sysconfdir\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of system-wide configuration files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgxs\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the location of extension makefiles.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--configure\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the options that were given to the \u003ccode class=\"filename\"\u003econfigure\u003c/code\u003e script when \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cc\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCC\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows the C compiler used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cppflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCPPFLAGS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows C compiler switches needed at preprocessing time (typically, \u003ccode class=\"literal\"\u003e-I\u003c/code\u003e switches).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCFLAGS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows C compiler switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--cflags_sl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eCFLAGS_SL\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows extra C compiler switches used for building shared libraries.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLDFLAGS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows linker switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags_ex\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLDFLAGS_EX\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows linker switches used for building executables only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--ldflags_sl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLDFLAGS_SL\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This shows linker switches used for building shared libraries only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--libs\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the value of the \u003ccode class=\"varname\"\u003eLIBS\u003c/code\u003e variable that was used for building \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e. This normally contains \u003ccode class=\"literal\"\u003e-l\u003c/code\u003e switches for external libraries linked into \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the version of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_config\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eIf 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.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.7\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eThe options \u003ccode class=\"option\"\u003e--docdir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--pkgincludedir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--localedir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--mandir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--sharedir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--sysconfdir\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cc\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cppflags\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cflags\u003c/code\u003e, \u003ccode class=\"option\"\u003e--cflags_sl\u003c/code\u003e, \u003ccode class=\"option\"\u003e--ldflags\u003c/code\u003e, \u003ccode class=\"option\"\u003e--ldflags_sl\u003c/code\u003e, and \u003ccode class=\"option\"\u003e--libs\u003c/code\u003e were added in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.1. The option \u003ccode class=\"option\"\u003e--htmldir\u003c/code\u003e was added in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.4. The option \u003ccode class=\"option\"\u003e--ldflags_ex\u003c/code\u003e was added in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 9.0.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.13.8\"\u003e\n\u003ch2\u003eExample\u003c/h2\u003e\n\u003cp\u003eTo reproduce the build configuration of the current PostgreSQL installation, run the following command:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eeval ./configure `pg_config --configure`\n\u003c/pre\u003e\n\u003cp\u003eThe output of \u003ccode class=\"literal\"\u003epg_config --configure\u003c/code\u003e contains shell quotation marks so arguments with spaces are represented correctly. Therefore, using \u003ccode class=\"literal\"\u003eeval\u003c/code\u003e is required for proper results.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"--bindir","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."},{"signature":{"text":"--docdir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of documentation files."},{"signature":{"text":"--htmldir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of HTML documentation files."},{"signature":{"text":"--includedir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of C header files of the client interfaces."},{"signature":{"text":"--pkgincludedir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of other C header files."},{"signature":{"text":"--includedir-server","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of C header files for server programming."},{"signature":{"text":"--libdir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of object code libraries."},{"signature":{"text":"--pkglibdir","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.)"},{"signature":{"text":"--localedir","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.)"},{"signature":{"text":"--mandir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of manual pages."},{"signature":{"text":"--sharedir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of architecture-independent support files."},{"signature":{"text":"--sysconfdir","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of system-wide configuration files."},{"signature":{"text":"--pgxs","url":"/docs/18/app-pgconfig.html"},"summary":"Print the location of extension makefiles."},{"signature":{"text":"--configure","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."},{"signature":{"text":"--cc","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."},{"signature":{"text":"--cppflags","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)."},{"signature":{"text":"--cflags","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."},{"signature":{"text":"--cflags_sl","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."},{"signature":{"text":"--ldflags","url":"/docs/18/app-pgconfig.html"},"summary":"Print the value of the LDFLAGS variable that was used for building PostgreSQL . This shows linker switches."},{"signature":{"text":"--ldflags_ex","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."},{"signature":{"text":"--ldflags_sl","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."},{"signature":{"text":"--libs","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 ."},{"signature":{"text":"--version","url":"/docs/18/app-pgconfig.html"},"summary":"Print the version of PostgreSQL ."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgconfig.html"},"summary":"Show help about pg_config command line arguments, and exit."}],"title":"Documented options"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
