1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!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="pgbench.html" title="pgbench" /><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="pgbench.html" title="pgbench">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 15.5 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.12.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.12.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.12.5"><h2>Description</h2><p>
The <span class="application">pg_config</span> utility prints configuration parameters
of the currently installed version of <span class="productname">PostgreSQL</span>. It is
intended, for example, to be used by software packages that want to interface
to <span class="productname">PostgreSQL</span> to facilitate finding the required header files
and libraries.
</p></div><div class="refsect1" id="id-1.9.4.12.6"><h2>Options</h2><p>
To use <span class="application">pg_config</span>, supply one or more of the following
options:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">--bindir</code></span></dt><dd><p>
Print the location of user executables. Use this, for example, to find
the <code class="command">psql</code> program. This is normally also the location
where the <code class="filename">pg_config</code> program resides.
</p></dd><dt><span class="term"><code class="option">--docdir</code></span></dt><dd><p>
Print the location of documentation files.
</p></dd><dt><span class="term"><code class="option">--htmldir</code></span></dt><dd><p>
Print the location of HTML documentation files.
</p></dd><dt><span class="term"><code class="option">--includedir</code></span></dt><dd><p>
Print the location of C header files of the client interfaces.
</p></dd><dt><span class="term"><code class="option">--pkgincludedir</code></span></dt><dd><p>
Print the location of other C header files.
</p></dd><dt><span class="term"><code class="option">--includedir-server</code></span></dt><dd><p>
Print the location of C header files for server programming.
</p></dd><dt><span class="term"><code class="option">--libdir</code></span></dt><dd><p>
Print the location of object code libraries.
</p></dd><dt><span class="term"><code class="option">--pkglibdir</code></span></dt><dd><p>
Print the location of dynamically loadable modules, or where
the server would search for them. (Other
architecture-dependent data files might also be installed in this
directory.)
</p></dd><dt><span class="term"><code class="option">--localedir</code></span></dt><dd><p>
Print the location of locale support files. (This will be an empty
string if locale support was not configured when
<span class="productname">PostgreSQL</span> was built.)
</p></dd><dt><span class="term"><code class="option">--mandir</code></span></dt><dd><p>
Print the location of manual pages.
</p></dd><dt><span class="term"><code class="option">--sharedir</code></span></dt><dd><p>
Print the location of architecture-independent support files.
</p></dd><dt><span class="term"><code class="option">--sysconfdir</code></span></dt><dd><p>
Print the location of system-wide configuration files.
</p></dd><dt><span class="term"><code class="option">--pgxs</code></span></dt><dd><p>
Print the location of extension makefiles.
</p></dd><dt><span class="term"><code class="option">--configure</code></span></dt><dd><p>
Print the options that were given to the <code class="filename">configure</code>
script when <span class="productname">PostgreSQL</span> was configured for building.
This can be used to reproduce the identical configuration, or
to find out with what options a binary package was built. (Note
however that binary packages often contain vendor-specific custom
patches.) See also the examples below.
</p></dd><dt><span class="term"><code class="option">--cc</code></span></dt><dd><p>
Print the value of the <code class="varname">CC</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This shows the C compiler used.
</p></dd><dt><span class="term"><code class="option">--cppflags</code></span></dt><dd><p>
Print the value of the <code class="varname">CPPFLAGS</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This shows C compiler switches needed
at preprocessing time (typically, <code class="literal">-I</code> switches).
</p></dd><dt><span class="term"><code class="option">--cflags</code></span></dt><dd><p>
Print the value of the <code class="varname">CFLAGS</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This shows C compiler switches.
</p></dd><dt><span class="term"><code class="option">--cflags_sl</code></span></dt><dd><p>
Print the value of the <code class="varname">CFLAGS_SL</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This shows extra C compiler switches
used for building shared libraries.
</p></dd><dt><span class="term"><code class="option">--ldflags</code></span></dt><dd><p>
Print the value of the <code class="varname">LDFLAGS</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This shows linker switches.
</p></dd><dt><span class="term"><code class="option">--ldflags_ex</code></span></dt><dd><p>
Print the value of the <code class="varname">LDFLAGS_EX</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This shows linker switches
used for building executables only.
</p></dd><dt><span class="term"><code class="option">--ldflags_sl</code></span></dt><dd><p>
Print the value of the <code class="varname">LDFLAGS_SL</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This shows linker switches
used for building shared libraries only.
</p></dd><dt><span class="term"><code class="option">--libs</code></span></dt><dd><p>
Print the value of the <code class="varname">LIBS</code> variable that was used for building
<span class="productname">PostgreSQL</span>. This normally contains <code class="literal">-l</code>
switches for external libraries linked into <span class="productname">PostgreSQL</span>.
</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>
Print the version of <span class="productname">PostgreSQL</span>.
</p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p>
Show help about <span class="application">pg_config</span> command line
arguments, and exit.
</p></dd></dl></div><p>
If more than one option is given, the information is printed in that order,
one item per line. If no options are given, all available information
is printed, with labels.
</p></div><div class="refsect1" id="id-1.9.4.12.7"><h2>Notes</h2><p>
The options <code class="option">--docdir</code>, <code class="option">--pkgincludedir</code>,
<code class="option">--localedir</code>, <code class="option">--mandir</code>,
<code class="option">--sharedir</code>, <code class="option">--sysconfdir</code>,
<code class="option">--cc</code>, <code class="option">--cppflags</code>,
<code class="option">--cflags</code>, <code class="option">--cflags_sl</code>,
<code class="option">--ldflags</code>, <code class="option">--ldflags_sl</code>,
and <code class="option">--libs</code> were added in <span class="productname">PostgreSQL</span> 8.1.
The option <code class="option">--htmldir</code> was added in <span class="productname">PostgreSQL</span> 8.4.
The option <code class="option">--ldflags_ex</code> was added in <span class="productname">PostgreSQL</span> 9.0.
</p></div><div class="refsect1" id="id-1.9.4.12.8"><h2>Example</h2><p>
To reproduce the build configuration of the current PostgreSQL
installation, run the following command:
</p><pre class="programlisting">
eval ./configure `pg_config --configure`
</pre><p>
The output of <code class="literal">pg_config --configure</code> contains
shell quotation marks so arguments with spaces are represented
correctly. Therefore, using <code class="literal">eval</code> is required
for proper results.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgbench.html" title="pgbench">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">pgbench</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 15.5 Documentation">Home</a></td><td width="40%" align="right" valign="top"> <span class="application">pg_dump</span></td></tr></table></div></body></html>
|