1PG_CONFIG(1)            PostgreSQL Client Applications            PG_CONFIG(1)
2
3
4

NAME

6       pg_config  -  retrieve information about the installed version of Post‐
7       greSQL
8
9

SYNOPSIS

11       pg_config [ option... ]
12

DESCRIPTION

14       The pg_config utility prints configuration parameters of the  currently
15       installed  version  of  PostgreSQL.  It is intended, for example, to be
16       used by software packages that  want  to  interface  to  PostgreSQL  to
17       facilitate finding the required header files and libraries.
18

OPTIONS

20       To use pg_config, supply one or more of the following options:
21
22       --bindir
23              Print  the  location of user executables. Use this, for example,
24              to find the psql program. This is  normally  also  the  location
25              where the pg_config program resides.
26
27       --docdir
28              Print the location of documentation files.
29
30       --htmldir
31              Print the location of HTML documentation files.
32
33       --includedir
34              Print the location of C header files of the client interfaces.
35
36       --pkgincludedir
37              Print the location of other C header files.
38
39       --includedir-server
40              Print the location of C header files for server programming.
41
42       --libdir
43              Print the location of object code libraries.
44
45       --pkglibdir
46              Print the location of dynamically loadable modules, or where the
47              server would search for them. (Other architecture-dependent data
48              files might also be installed in this directory.)
49
50       --localedir
51              Print  the  location  of  locale support files. (This will be an
52              empty string if locale support was  not  configured  when  Post‐
53              greSQL was built.)
54
55       --mandir
56              Print the location of manual pages.
57
58       --sharedir
59              Print the location of architecture-independent support files.
60
61       --sysconfdir
62              Print the location of system-wide configuration files.
63
64       --pgxs Print the location of extension makefiles.
65
66       --configure
67              Print  the  options that were given to the configure script when
68              PostgreSQL was configured for building.  This  can  be  used  to
69              reproduce  the identical configuration, or to find out with what
70              options a binary package was built. (Note  however  that  binary
71              packages often contain vendor-specific custom patches.) See also
72              the examples below.
73
74       --cc   Print the value of the CC variable that was  used  for  building
75              PostgreSQL. This shows the C compiler used.
76
77       --cppflags
78              Print  the  value  of  the  CPPFLAGS  variable that was used for
79              building PostgreSQL. This shows C compiler  switches  needed  at
80              preprocessing time (typically, -I switches).
81
82       --cflags
83              Print  the value of the CFLAGS variable that was used for build‐
84              ing PostgreSQL. This shows C compiler switches.
85
86       --cflags_sl
87              Print the value of the CFLAGS_SL  variable  that  was  used  for
88              building  PostgreSQL.  This shows extra C compiler switches used
89              for building shared libraries.
90
91       --ldflags
92              Print the value of the LDFLAGS variable that was used for build‐
93              ing PostgreSQL. This shows linker switches.
94
95       --ldflags_sl
96              Print  the  value  of  the LDFLAGS_SL variable that was used for
97              building PostgreSQL. This shows linker switches used for  build‐
98              ing shared libraries.
99
100       --libs Print  the value of the LIBS variable that was used for building
101              PostgreSQL. This normally  contains  -l  switches  for  external
102              libraries linked into PostgreSQL.
103
104       --version
105              Print the version of PostgreSQL.
106
107       If  more  than  one option is given, the information is printed in that
108       order, one item per line. If no options are given, all available infor‐
109       mation is printed, with labels.
110

NOTES

112       The  option  --includedir-server  was  new  in PostgreSQL 7.2. In prior
113       releases, the server include files were installed in the same  location
114       as  the  client  headers,  which  could  be  queried  with  the  option
115       --includedir. To make your package handle both  cases,  try  the  newer
116       option first and test the exit status to see whether it succeeded.
117
118       The   options   --docdir,   --pkgincludedir,   --localedir,   --mandir,
119       --sharedir,  --sysconfdir,  --cc,  --cppflags,  --cflags,  --cflags_sl,
120       --ldflags,  --ldflags_sl,  and  --libs  are new in PostgreSQL 8.1.  The
121       option --htmldir is new in PostgreSQL 8.4.
122
123       In releases prior to PostgreSQL 7.1, before pg_config  came  to  be,  a
124       method  for  finding  the  equivalent configuration information did not
125       exist.
126

EXAMPLE

128       To reproduce the build configuration of the current PostgreSQL  instal‐
129       lation, run the following command:
130
131       eval ./configure `pg_config --configure`
132
133       The  output  of pg_config --configure contains shell quotation marks so
134       arguments with spaces are represented correctly. Therefore, using  eval
135       is required for proper results.
136
137
138
139Application                       2011-09-22                      PG_CONFIG(1)
Impressum