codekingpro/portable-devtools
115k
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="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 16.3 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>3 The <span class="application">pg_config</span> utility prints configuration parameters4 of the currently installed version of <span class="productname">PostgreSQL</span>. It is5 intended, for example, to be used by software packages that want to interface6 to <span class="productname">PostgreSQL</span> to facilitate finding the required header files7 and libraries.8 </p></div><div class="refsect1" id="id-1.9.4.12.6"><h2>Options</h2><p>9 To use <span class="application">pg_config</span>, supply one or more of the following10 options: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 find13 the <code class="command">psql</code> program. This is normally also the location14 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 where29 the server would search for them. (Other30 architecture-dependent data files might also be installed in this31 directory.)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 empty34 string if locale support was not configured when35 <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, or48 to find out with what options a binary package was built. (Note49 however that binary packages often contain vendor-specific custom50 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 building53 <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 building56 <span class="productname">PostgreSQL</span>. This shows C compiler switches needed57 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 building60 <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 building63 <span class="productname">PostgreSQL</span>. This shows extra C compiler switches64 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 building67 <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 building70 <span class="productname">PostgreSQL</span>. This shows linker switches71 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 building74 <span class="productname">PostgreSQL</span>. This shows linker switches75 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 building78 <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 line84 arguments, and exit.85 </p></dd></dl></div><p>86 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 information89 is printed, with labels.90 </p></div><div class="refsect1" id="id-1.9.4.12.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.12.8"><h2>Example</h2><p>101 To reproduce the build configuration of the current PostgreSQL102 installation, run the following command:103</p><pre class="programlisting">104eval ./configure `pg_config --configure`105</pre><p>106 The output of <code class="literal">pg_config --configure</code> contains107 shell quotation marks so arguments with spaces are represented108 correctly. Therefore, using <code class="literal">eval</code> is required109 for proper results.110 </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 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> <span class="application">pg_dump</span></td></tr></table></div></body></html>