PG_CONFIG(1)
π pg_config β bestie edition π
okay so this is the manual page for pg_config, which lives in the PostgreSQL 18.6 Documentation set. yeah. it's a whole manual page. for one (1) little utility. and honestly? it eats. π
β¨ NAME β¨
pg_config β literally just goes and fetches info about the PostgreSQL version you have installed on your machine. that's it. that's the job. π
π¦ SYNOPSIS π¦
pg_config [option...]
πΈ DESCRIPTION πΈ
so pg_config prints out the configuration parameters of the PostgreSQL version that's currently installed. iconic behavior honestly.
and like, who is this even for? bestie, it's for software packages that wanna interface with PostgreSQL β it helps them find the header files and libraries they need. it's basically the friend who knows where everything is at the party. π«Ά
π OPTIONS π
to use pg_config, you give it one or more of these. one. or more. your call, queen. π
--bindirβ prints where the user executables live. use this, for example, to find thepsqlprogram. this is normally also where thepg_configprogram itself resides. it's giving "home address" energy. π--docdirβ prints where the documentation files are. π--htmldirβ prints where the HTML documentation files are. π--includedirβ prints where the C header files of the client interfaces are. π§--pkgincludedirβ prints where the other C header files are. (the rest of them. the understudies.) π--includedir-serverβ prints where the C header files for server programming are. π₯οΈ--libdirβ prints where the object code libraries are. π¦--pkglibdirβ prints where the dynamically loadable modules are, or where the server would go searching for them. (other architecture-dependent data files might also be installed in this directory, so like, don't be shocked.) π--localedirβ prints where the locale support files are. heads up: this will be an empty string if locale support wasn't configured when PostgreSQL was built. empty. nada. π--mandirβ prints where the manual pages are. (hello, you are here π«΅)--sharedirβ prints where the architecture-independent support files are. π--sysconfdirβ prints where the system-wide configuration files are. βοΈ--pgxsβ prints where the extension makefiles are. π οΈ--configureβ prints the options that were given to theconfigurescript when PostgreSQL was configured for building. you can use this to reproduce the identical configuration, or to figure out with what options a binary package was built. β οΈ note though: binary packages often contain vendor-specific custom patches, so it's not always a perfect match. 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 the 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β shows help aboutpg_configcommand line arguments, and exits. bye bestie π
so if you give it more than one option, the info gets printed in that order, one item per line. and if you give it no options at all? it prints all available information, with labels. everything. the whole wardrobe. π§
π NOTES π
some lore for you, because history matters:
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.
and the option --ldflags_ex was added in PostgreSQL 9.0.
glow-up timeline. π
π EXAMPLE π
wanna reproduce the build configuration of the current PostgreSQL installation? run this, bestie:
eval ./configure `pg_config --configure`
the output of pg_config --configure contains shell quotation marks so that arguments with spaces are represented correctly. therefore, using eval is required for proper results. don't skip the eval. the eval is not optional. the eval is the moment. π€
and that's the whole page, gorgeous. this was pg_config from the PostgreSQL 18.6 docs, dated 2026. go find your header files. slay. πβ¨ππ¦
π¦ where this page comes from
- fedora 43: postgresql-server-devel 18.6-1.fc43 Β· PostgreSQL
- fedora 43: postgresql-server-devel 18.6-1.fc43 Β· PostgreSQL
- fedora 44: postgresql-server-devel 18.6-1.fc44 Β· PostgreSQL
- fedora 44: postgresql-server-devel 18.6-1.fc44 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms