Print 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.
Print the options that were given to the configure script when PostgreSQL was built. This can be used to reproduce the identical configuration, or to find out with what options a binary package was built.
Print the location of C and C++ header files of the client interfaces.
Print the location of C and C++ header files for server programming.
Print the location of object code libraries.
Print the location of dynamically loadable modules, or where the server would search for them. (Other architecture-dependent data files may also be installed in this directory.)
Print the version of PostgreSQL.
The pg_config utility provides configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be used by software packages that want to interface to PostgreSQL in order to find the respective header files and libraries.
The option --includedir-server is new in PostgreSQL 7.2. In prior releases, the server include files were installed in the same location as the client headers, which could be queried with the --includedir. To make your package handle both cases, try the newer option first and test the exit status to see whether it succeeded.