PG_CONFIG(1)

πŸ“¦ version 15.19, in opensuse-leap 16.0

πŸŽ€ 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 the psql program. This is normally also the location where the pg_config program 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 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 πŸ”
  • --cc β€” prints the value of the CC variable that was used for building PostgreSQL. This shows the C compiler used πŸ§‘β€πŸ’»
  • --cppflags β€” prints the value of the CPPFLAGS variable that was used for building PostgreSQL. This shows C compiler switches needed at preprocessing time (typically, -I switches) πŸ’…
  • --cflags β€” prints the value of the CFLAGS variable that was used for building PostgreSQL. This shows C compiler switches πŸŽ›οΈ
  • --cflags_sl β€” prints the value of the CFLAGS_SL variable that was used for building PostgreSQL. This shows extra C compiler switches used for building shared libraries 🧡
  • --ldflags β€” prints the value of the LDFLAGS variable that was used for building PostgreSQL. This shows linker switches πŸ”—
  • --ldflags_ex β€” prints the value of the LDFLAGS_EX variable that was used for building PostgreSQL. This shows linker switches used for building executables only πŸƒ
  • --ldflags_sl β€” prints the value of the LDFLAGS_SL variable that was used for building PostgreSQL. This shows linker switches used for building shared libraries only 🫧
  • --libs β€” prints the value of the LIBS variable that was used for building PostgreSQL. This normally contains -l switches for external libraries linked into PostgreSQL πŸ“š
  • --version β€” prints the version of PostgreSQL 🏷️
  • -?, --help β€” show help about pg_config command 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 πŸ«ΆπŸŽ€