pg_config

A server utility providing information about how PostgreSQL was built

pg_config is a server utility providing information about how the installed version of PostgreSQL was built.

pg_config was added in PostgreSQL 7.1.

Usage

pg_config lists the configuration parameters of the currently installed version of PostgreSQL. By default all parameters are dumped, however individual parameters can be specified with the respective option, e.g. --bindir.

From PostgreSQL 9.6, these values can also be queried directly from the eponymous view pg_config.

Change history

Examples

Sample pg_config output with no options specified:

$ pg_config
BINDIR = /usr/local/pgsql/bin
DOCDIR = /usr/local/pgsql/share/doc
HTMLDIR = /usr/local/pgsql/share/doc
INCLUDEDIR = /usr/local/pgsql/include
PKGINCLUDEDIR = /usr/local/pgsql/include
INCLUDEDIR-SERVER = /usr/local/pgsql/include/server
LIBDIR = /usr/local/pgsql/lib
PKGLIBDIR = /usr/local/pgsql/lib
LOCALEDIR = /usr/local/pgsql/share/locale
MANDIR = /usr/local/pgsql/share/man
SHAREDIR = /usr/local/pgsql/share
SYSCONFDIR = /usr/local/pgsql/etc
PGXS = /usr/local/pgsql/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--prefix=/usr/local/pgsql'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
  -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3
  -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
  -Wno-format-truncation -O2
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lz -lreadline -lpthread -lrt -ldl -lm 
VERSION = PostgreSQL 14devel

With a single option specified:

$ pg_config --bindir
/usr/local/pgsql/bin

With multiple options specified:

$ pg_config  --cc --version
gcc
PostgreSQL 14devel

Categories

Server utility

See also

pg_config (view)