PG_CONFIG(1)

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

🌸 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 the psql program. This is normally also where the pg_config program 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 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. 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! πŸŽ€βœ¨