PG_CONFIG(1)
πΈ NAME (a.k.a. PG_CONFIG(1)) πΈ
okay so pg_config β retrieve information about the installed version of PostgreSQL. that's the whole assignment, bestie π
β¨ SYNOPSIS β¨
pg_config [option...]
π DESCRIPTION π
so the pg_config utility prints configuration parameters of the currently installed version of PostgreSQL. it's intended, for example, to be used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries. it's giving helpful little directory bestie energy, no cap π«Ά
π OPTIONS π
to use pg_config, supply one or more of the following options, bestie:
--bindirβ print the location of user executables. use this, for example, to find thepsqlprogram. this is normally also the location where thepg_configprogram resides. π--docdirβ print the location of documentation files. π--htmldirβ print the location of HTML documentation files. π--includedirβ print the location of C header files of the client interfaces. π§--pkgincludedirβ print the location of other C header files. π--includedir-serverβ print the location of C header files for server programming. π₯οΈ--libdirβ print the location of object code libraries. π--pkglibdirβ print the location of dynamically loadable modules, or where the server would search for them. (other architecture-dependent data files might also be installed in this directory.) π--localedirβ print the location of locale support files. (this will be an empty string if locale support was not configured when PostgreSQL was built.) π--mandirβ print the location of manual pages. π--sharedirβ print the location of architecture-independent support files. π--sysconfdirβ print the location of system-wide configuration files. βοΈ--pgxsβ print the location of extension makefiles. π οΈ--configureβ print the options that were given to 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β print the value of theCCvariable that was used for building PostgreSQL. this shows the C compiler used. π₯--cppflagsβ print the value of theCPPFLAGSvariable that was used for building PostgreSQL. this shows C compiler switches needed at preprocessing time (typically,-Iswitches). π§--cflagsβ print the value of theCFLAGSvariable that was used for building PostgreSQL. this shows C compiler switches. β¨--cflags_slβ print the value of theCFLAGS_SLvariable that was used for building PostgreSQL. this shows extra C compiler switches used for building shared libraries. π--ldflagsβ print the value of theLDFLAGSvariable that was used for building PostgreSQL. this shows linker switches. π--ldflags_exβ print the value of theLDFLAGS_EXvariable that was used for building PostgreSQL. this shows linker switches used for building executables only. π--ldflags_slβ print the value of theLDFLAGS_SLvariable that was used for building PostgreSQL. this shows linker switches used for building shared libraries only. π§΅--libsβ print the value of theLIBSvariable that was used for building PostgreSQL. this normally contains-lswitches for external libraries linked into PostgreSQL. π¦--versionβ print 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. periodt π
π¦ NOTES π¦
fun little timeline, bestie: 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. we love a historical receipt π
π 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. do not skip the eval, bestie β it's literally required for proper results π
π xoxo, that's the whole PG_CONFIG(1) moment. this iconic little manual page is from PostgreSQL 14.24, dated 2026, and it ate, no crumbs. periodt. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14-server-devel 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14-server-devel 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14-server-devel 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14-server-devel 14.24-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