PG_CONFIG(1)
πΈ NAME πΈ
Okay bestie, this is the pg_config page from the PostgreSQL 13.23 Documentation. It's literally the utility that tells you all about how your installed PostgreSQL was built. π
β¨ SYNOPSIS β¨
pg_config [option...]
π DESCRIPTION π
So pg_config is that bestie who spills the tea on the configuration parameters of the PostgreSQL version you currently have installed. Software packages that want to interface with PostgreSQL use it β for example β to find the header files and libraries they need. It's giving "helpful connector friend" energy. π«Ά
π OPTIONS π
To use pg_config, supply one or more of these options:
--bindirβ prints where the user executables live. Use this, for example, to find thepsqlprogram. This is normally also where thepg_configprogram itself resides.--docdirβ prints where documentation files live.--htmldirβ prints where HTML documentation files live.--includedirβ prints where the C header files for the client interfaces live.--pkgincludedirβ prints where other C header files live.--includedir-serverβ prints where the C header files for server programming live.--libdirβ prints where object code libraries live.--pkglibdirβ prints where dynamically loadable modules live, or where the server would search for them. (Other architecture-dependent data files might also be installed in this directory.)--localedirβ prints where locale support files live. (This will be an empty string if locale support was not configured when PostgreSQL was built.)--mandirβ prints where manual pages live.--sharedirβ prints where architecture-independent support files live.--sysconfdirβ prints where system-wide configuration files live.--pgxsβ prints where extension makefiles live.--configureβ prints the options that were given to theconfigurescript when PostgreSQL was configured for building. This can be used to reproduce the identical configuration, or to find out with what options a binary package was built. (Note however that binary packages often contain vendor-specific custom patches.) See also the examples below.--ccβ prints the value of theCCvariable that was used for building PostgreSQL. This shows the C compiler used.--cppflagsβ prints the value of theCPPFLAGSvariable that was used for building PostgreSQL. This shows C compiler switches needed at preprocessing time (typically,-Iswitches).--cflagsβ prints the value of theCFLAGSvariable that was used for building PostgreSQL. This shows C compiler switches.--cflags_slβ prints the value of theCFLAGS_SLvariable that was used for building PostgreSQL. This shows extra C compiler switches used for building shared libraries.--ldflagsβ prints the value of theLDFLAGSvariable that was used for building PostgreSQL. This shows linker switches.--ldflags_exβ prints the value of theLDFLAGS_EXvariable that was used for building PostgreSQL. This shows linker switches used for building executables only.--ldflags_slβ prints the value of theLDFLAGS_SLvariable that was used for building PostgreSQL. This shows linker switches used for building shared libraries only.--libsβ prints the value of theLIBSvariable that was used for building PostgreSQL. This normally contains-lswitches for external libraries linked into PostgreSQL.--versionβ prints the version of PostgreSQL.-?,--helpβ show help aboutpg_configcommand line arguments, and exit.
If more than one option is given, the information is printed in that order, one item per line. If no options are given, all available information is printed, with labels. Slay. β¨
π¦ NOTES π¦
The options --docdir, --pkgincludedir, --localedir, --mandir, --sharedir, --sysconfdir, --cc, --cppflags, --cflags, --cflags_sl, --ldflags, --ldflags_sl, and --libs were added in PostgreSQL 8.1. The option --htmldir was added in PostgreSQL 8.4. The option --ldflags_ex was added in PostgreSQL 9.0.
π EXAMPLE π
To reproduce the build configuration of the current PostgreSQL installation, run this command:
eval ./configure `pg_config --configure`
The output of pg_config --configure contains shell quotation marks so arguments with spaces are represented correctly. Therefore, using eval is required for proper results. No cap. π
π source/version: PostgreSQL 13.23 β date: 2025 β that's the whole page, bestie! πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13-server-devel 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13-server-devel 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13-server-devel 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13-server-devel 13.23-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms