1PG_CONFIG(1) PostgreSQL Client Applications PG_CONFIG(1)
2
3
4
6 pg_config - retrieve information about the installed version of Post‐
7 greSQL
8
9
11 pg_config [ option... ]
12
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
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. (This will be an
29 empty string if --without-docdir was specified when PostgreSQL
30 was built.)
31
32 --includedir
33 Print the location of C header files of the client interfaces.
34
35 --pkgincludedir
36 Print the location of other C header files.
37
38 --includedir-server
39 Print the location of C header files for server programming.
40
41 --libdir
42 Print the location of object code libraries.
43
44 --pkglibdir
45 Print the location of dynamically loadable modules, or where the
46 server would search for them. (Other architecture-dependent data
47 files may also be installed in this directory.)
48
49 --localedir
50 Print the location of locale support files. (This will be an
51 empty string if locale support was not configured when Post‐
52 greSQL was built.)
53
54 --mandir
55 Print the location of manual pages.
56
57 --sharedir
58 Print the location of architecture-independent support files.
59
60 --sysconfdir
61 Print the location of system-wide configuration files.
62
63 --pgxs Print the location of extension makefiles.
64
65 --configure
66 Print the options that were given to the configure script when
67 PostgreSQL was configured for building. This can be used to
68 reproduce the identical configuration, or to find out with what
69 options a binary package was built. (Note however that binary
70 packages often contain vendor-specific custom patches.) See also
71 the examples below.
72
73 --cc Print the value of the CC variable that was used for building
74 PostgreSQL. This shows the C compiler used.
75
76 --cppflags
77 Print the value of the CPPFLAGS variable that was used for
78 building PostgreSQL. This shows C compiler switches needed at
79 preprocessing time (typically, -I switches).
80
81 --cflags
82 Print the value of the CFLAGS variable that was used for build‐
83 ing PostgreSQL. This shows C compiler switches.
84
85 --cflags_sl
86 Print the value of the CFLAGS_SL variable that was used for
87 building PostgreSQL. This shows extra C compiler switches used
88 for building shared libraries.
89
90 --ldflags
91 Print the value of the LDFLAGS variable that was used for build‐
92 ing PostgreSQL. This shows linker switches.
93
94 --ldflags_sl
95 Print the value of the LDFLAGS_SL variable that was used for
96 building PostgreSQL. This shows linker switches used for build‐
97 ing shared libraries.
98
99 --libs Print the value of the LIBS variable that was used for building
100 PostgreSQL. This normally contains -l switches for external
101 libraries linked into PostgreSQL.
102
103 --version
104 Print the version of PostgreSQL.
105
106 If more than one option is given, the information is printed in that
107 order, one item per line. If no options are given, all available infor‐
108 mation is printed, with labels.
109
111 The option --includedir-server was new in PostgreSQL 7.2. In prior
112 releases, the server include files were installed in the same location
113 as the client headers, which could be queried with the option
114 --includedir. To make your package handle both cases, try the newer
115 option first and test the exit status to see whether it succeeded.
116
117 The options --docdir, --pkgincludedir, --localedir, --mandir,
118 --sharedir, --sysconfdir, --cc, --cppflags, --cflags, --cflags_sl,
119 --ldflags, --ldflags_sl, and --libs are new in PostgreSQL 8.1.
120
121 In releases prior to PostgreSQL 7.1, before pg_config came to be, a
122 method for finding the equivalent configuration information did not
123 exist.
124
126 To reproduce the build configuration of the current PostgreSQL instal‐
127 lation, run the following command:
128
129 eval ./configure `pg_config --configure`
130
131 The output of pg_config --configure contains shell quotation marks so
132 arguments with spaces are represented correctly. Therefore, using eval
133 is required for proper results.
134
136 The pg_config utility first appeared in PostgreSQL 7.1.
137
138
139
140Application 2008-06-08 PG_CONFIG(1)