{"Entry":{"collection":"tool","key":"pg-config","name":"pg_config","aliases":["pg_config"],"metadata":{"aliases":["pg_config"],"category":"Client applications","content_hash":"1669c42c2bcf003f2b628a460a60800c63614b075186cee5f0281271f679b711","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"],"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"}],"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":[],"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"}]},"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":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
