PG_CONFIG(1)
π NAME π
okay so welcome to PG_CONFIG(1) β the pg_config manual page, bestie β¨
pg_config β retrieve information about the installed version of PostgreSQL π
β¨ SYNOPSIS β¨
pg_config [option...]
π DESCRIPTION π
The pg_config utility prints configuration parameters of the currently installed version of PostgreSQL. Itβs literally designed for things like software packages that want to interface to PostgreSQL and need help finding the required header files and libraries π«Ά
πΈ OPTIONS πΈ
To use pg_config, supply one or more of the following options, bestie:
--bindirβ prints the location of user executables. Use this, for example, to find thepsqlprogram. This is normally also the location where thepg_configprogram resides π«--docdirβ prints the location of documentation files π--htmldirβ prints the location of HTML documentation files π--includedirβ prints the location of C header files of the client interfaces π§--pkgincludedirβ prints the location of other C header files π--includedir-serverβ prints the location of C header files for server programming π₯οΈ--libdirβ prints the location of object code libraries π¦--pkglibdirβ prints the location of dynamically loadable modules, or where the server would search for them. (Other architecture-dependent data files might also be installed in this directory.) π--localedirβ prints the location of locale support files. (This will be an empty string if locale support was not configured when PostgreSQL was built.) π--mandirβ prints the location of manual pages π--sharedirβ prints the location of architecture-independent support files ποΈ--sysconfdirβ prints the location of system-wide configuration files βοΈ--pgxsβ prints the location of extension makefiles π οΈ--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 π
π¦ NOTES π¦
The options --docdir, --pkgincludedir, --localedir, --mandir, --sharedir, --sysconfdir, --cc, --cppflags, --cflags, --cflags_sl, --ldflags, --ldflags_sl, and --libs were added in PostgreSQL 8.1. The option --htmldir was added in PostgreSQL 8.4. The option --ldflags_ex was added in PostgreSQL 9.0 β
π EXAMPLE π
To reproduce the build configuration of the current PostgreSQL installation, run the following command:
eval ./configure `pg_config --configure`
The output of pg_config --configure contains shell quotation marks so arguments with spaces are represented correctly. Therefore, using eval is required for proper results π―
π Thatβs the whole pg_config(1) moment, bestie β from PostgreSQL 15.19, dated 2026. Stay slay and may your paths always be found π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-server-devel 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-server-devel 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-server-devel 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-server-devel 15.19-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