1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>pg_config</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="app-pgcombinebackup.html" title="pg_combinebackup" /><link rel="next" href="app-pgdump.html" title="pg_dump" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center"><span class="application">pg_config</span></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="app-pgcombinebackup.html" title="pg_combinebackup">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-client.html" title="PostgreSQL Client Applications">Up</a></td><th width="60%" align="center">PostgreSQL Client Applications</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="app-pgdump.html" title="pg_dump">Next</a></td></tr></table><hr /></div><div class="refentry" id="APP-PGCONFIG"><div class="titlepage"></div><a id="id-1.9.4.13.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">pg_config</span></span></h2><p>pg_config — retrieve information about the installed version of <span class="productname">PostgreSQL</span></p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p id="id-1.9.4.13.4.1"><code class="command">pg_config</code> [<em class="replaceable"><code>option</code></em>...]</p></div></div><div class="refsect1" id="id-1.9.4.13.5"><h2>Description</h2><p>
3 The <span class="application">pg_config</span> utility prints configuration parameters
4 of the currently installed version of <span class="productname">PostgreSQL</span>. It is
5 intended, for example, to be used by software packages that want to interface
6 to <span class="productname">PostgreSQL</span> to facilitate finding the required header files
8 </p></div><div class="refsect1" id="id-1.9.4.13.6"><h2>Options</h2><p>
9 To use <span class="application">pg_config</span>, supply one or more of the following
11 </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">--bindir</code></span></dt><dd><p>
12 Print the location of user executables. Use this, for example, to find
13 the <code class="command">psql</code> program. This is normally also the location
14 where the <code class="filename">pg_config</code> program resides.
15 </p></dd><dt><span class="term"><code class="option">--docdir</code></span></dt><dd><p>
16 Print the location of documentation files.
17 </p></dd><dt><span class="term"><code class="option">--htmldir</code></span></dt><dd><p>
18 Print the location of HTML documentation files.
19 </p></dd><dt><span class="term"><code class="option">--includedir</code></span></dt><dd><p>
20 Print the location of C header files of the client interfaces.
21 </p></dd><dt><span class="term"><code class="option">--pkgincludedir</code></span></dt><dd><p>
22 Print the location of other C header files.
23 </p></dd><dt><span class="term"><code class="option">--includedir-server</code></span></dt><dd><p>
24 Print the location of C header files for server programming.
25 </p></dd><dt><span class="term"><code class="option">--libdir</code></span></dt><dd><p>
26 Print the location of object code libraries.
27 </p></dd><dt><span class="term"><code class="option">--pkglibdir</code></span></dt><dd><p>
28 Print the location of dynamically loadable modules, or where
29 the server would search for them. (Other
30 architecture-dependent data files might also be installed in this
32 </p></dd><dt><span class="term"><code class="option">--localedir</code></span></dt><dd><p>
33 Print the location of locale support files. (This will be an empty
34 string if locale support was not configured when
35 <span class="productname">PostgreSQL</span> was built.)
36 </p></dd><dt><span class="term"><code class="option">--mandir</code></span></dt><dd><p>
37 Print the location of manual pages.
38 </p></dd><dt><span class="term"><code class="option">--sharedir</code></span></dt><dd><p>
39 Print the location of architecture-independent support files.
40 </p></dd><dt><span class="term"><code class="option">--sysconfdir</code></span></dt><dd><p>
41 Print the location of system-wide configuration files.
42 </p></dd><dt><span class="term"><code class="option">--pgxs</code></span></dt><dd><p>
43 Print the location of extension makefiles.
44 </p></dd><dt><span class="term"><code class="option">--configure</code></span></dt><dd><p>
45 Print the options that were given to the <code class="filename">configure</code>
46 script when <span class="productname">PostgreSQL</span> was configured for building.
47 This can be used to reproduce the identical configuration, or
48 to find out with what options a binary package was built. (Note
49 however that binary packages often contain vendor-specific custom
50 patches.) See also the examples below.
51 </p></dd><dt><span class="term"><code class="option">--cc</code></span></dt><dd><p>
52 Print the value of the <code class="varname">CC</code> variable that was used for building
53 <span class="productname">PostgreSQL</span>. This shows the C compiler used.
54 </p></dd><dt><span class="term"><code class="option">--cppflags</code></span></dt><dd><p>
55 Print the value of the <code class="varname">CPPFLAGS</code> variable that was used for building
56 <span class="productname">PostgreSQL</span>. This shows C compiler switches needed
57 at preprocessing time (typically, <code class="literal">-I</code> switches).
58 </p></dd><dt><span class="term"><code class="option">--cflags</code></span></dt><dd><p>
59 Print the value of the <code class="varname">CFLAGS</code> variable that was used for building
60 <span class="productname">PostgreSQL</span>. This shows C compiler switches.
61 </p></dd><dt><span class="term"><code class="option">--cflags_sl</code></span></dt><dd><p>
62 Print the value of the <code class="varname">CFLAGS_SL</code> variable that was used for building
63 <span class="productname">PostgreSQL</span>. This shows extra C compiler switches
64 used for building shared libraries.
65 </p></dd><dt><span class="term"><code class="option">--ldflags</code></span></dt><dd><p>
66 Print the value of the <code class="varname">LDFLAGS</code> variable that was used for building
67 <span class="productname">PostgreSQL</span>. This shows linker switches.
68 </p></dd><dt><span class="term"><code class="option">--ldflags_ex</code></span></dt><dd><p>
69 Print the value of the <code class="varname">LDFLAGS_EX</code> variable that was used for building
70 <span class="productname">PostgreSQL</span>. This shows linker switches
71 used for building executables only.
72 </p></dd><dt><span class="term"><code class="option">--ldflags_sl</code></span></dt><dd><p>
73 Print the value of the <code class="varname">LDFLAGS_SL</code> variable that was used for building
74 <span class="productname">PostgreSQL</span>. This shows linker switches
75 used for building shared libraries only.
76 </p></dd><dt><span class="term"><code class="option">--libs</code></span></dt><dd><p>
77 Print the value of the <code class="varname">LIBS</code> variable that was used for building
78 <span class="productname">PostgreSQL</span>. This normally contains <code class="literal">-l</code>
79 switches for external libraries linked into <span class="productname">PostgreSQL</span>.
80 </p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>
81 Print the version of <span class="productname">PostgreSQL</span>.
82 </p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p>
83 Show help about <span class="application">pg_config</span> command line
85 </p></dd></dl></div><p>
87 If more than one option is given, the information is printed in that order,
88 one item per line. If no options are given, all available information
89 is printed, with labels.
90 </p></div><div class="refsect1" id="id-1.9.4.13.7"><h2>Notes</h2><p>
91 The options <code class="option">--docdir</code>, <code class="option">--pkgincludedir</code>,
92 <code class="option">--localedir</code>, <code class="option">--mandir</code>,
93 <code class="option">--sharedir</code>, <code class="option">--sysconfdir</code>,
94 <code class="option">--cc</code>, <code class="option">--cppflags</code>,
95 <code class="option">--cflags</code>, <code class="option">--cflags_sl</code>,
96 <code class="option">--ldflags</code>, <code class="option">--ldflags_sl</code>,
97 and <code class="option">--libs</code> were added in <span class="productname">PostgreSQL</span> 8.1.
98 The option <code class="option">--htmldir</code> was added in <span class="productname">PostgreSQL</span> 8.4.
99 The option <code class="option">--ldflags_ex</code> was added in <span class="productname">PostgreSQL</span> 9.0.
100 </p></div><div class="refsect1" id="id-1.9.4.13.8"><h2>Example</h2><p>
101 To reproduce the build configuration of the current PostgreSQL
102 installation, run the following command:
103 </p><pre class="programlisting">
104 eval ./configure `pg_config --configure`
106 The output of <code class="literal">pg_config --configure</code> contains
107 shell quotation marks so arguments with spaces are represented
108 correctly. Therefore, using <code class="literal">eval</code> is required
110 </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="app-pgcombinebackup.html" title="pg_combinebackup">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-client.html" title="PostgreSQL Client Applications">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="app-pgdump.html" title="pg_dump">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">pg_combinebackup</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> <span class="application">pg_dump</span></td></tr></table></div></body></html>