]> granicus.if.org Git - postgresql/blob - doc/src/sgml/installation.sgml
d3326ce182bcb2a6bb83970574a4cf778f57f7d4
[postgresql] / doc / src / sgml / installation.sgml
1 <!-- doc/src/sgml/installation.sgml -->
2 <!--
3
4 The standalone version has some portions that are different from the version
5 that is integrated into the full documentation set, in particular as regards
6 links, so that INSTALL.html can be created without links to the main
7 documentation.  See standalone-profile.xsl for details.
8
9 -->
10
11 <chapter id="installation">
12  <title>Installation from Source Code</title>
13
14  <indexterm zone="installation">
15   <primary>installation</primary>
16  </indexterm>
17
18  <para>
19   This chapter describes the installation of
20   <productname>PostgreSQL</productname> using the source code
21   distribution.  (If you are installing a pre-packaged distribution,
22   such as an RPM or Debian package, ignore this chapter
23   and read the packager's instructions instead.)
24  </para>
25
26  <sect1 id="install-short">
27   <title>Short Version</title>
28
29   <para>
30 <synopsis>
31 ./configure
32 make
33 su
34 make install
35 adduser postgres
36 mkdir /usr/local/pgsql/data
37 chown postgres /usr/local/pgsql/data
38 su - postgres
39 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
40 /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data &gt;logfile 2&gt;&amp;1 &amp;
41 /usr/local/pgsql/bin/createdb test
42 /usr/local/pgsql/bin/psql test
43 </synopsis>
44    The long version is the rest of this
45    <phrase>chapter</phrase>.
46   </para>
47  </sect1>
48
49
50  <sect1 id="install-requirements">
51   <title>Requirements</title>
52
53   <para>
54    In general, a modern Unix-compatible platform should be able to run
55    <productname>PostgreSQL</productname>.
56    The platforms that had received specific testing at the
57    time of release are listed in <xref linkend="supported-platforms"/>
58    below. In the <filename>doc</filename> subdirectory of the distribution
59    there are several platform-specific <acronym>FAQ</acronym> documents you
60    might wish to consult if you are having trouble.
61   </para>
62
63   <para>
64    The following software packages are required for building
65    <productname>PostgreSQL</productname>:
66
67    <itemizedlist>
68     <listitem>
69      <para>
70       <indexterm>
71        <primary>make</primary>
72       </indexterm>
73
74       <acronym>GNU</acronym> <application>make</application> version 3.80 or newer is required; other
75       <application>make</application> programs or older <acronym>GNU</acronym> <application>make</application> versions will <emphasis>not</emphasis> work.
76       (<acronym>GNU</acronym> <application>make</application> is sometimes installed under
77       the name <filename>gmake</filename>.)  To test for <acronym>GNU</acronym>
78       <application>make</application> enter:
79 <screen>
80 <userinput>make --version</userinput>
81 </screen>
82      </para>
83     </listitem>
84
85     <listitem>
86      <para>
87       You need an <acronym>ISO</acronym>/<acronym>ANSI</acronym> C compiler (at least
88       C99-compliant). Recent
89       versions of <productname>GCC</productname> are recommended, but
90       <productname>PostgreSQL</productname> is known to build using a wide variety
91       of compilers from different vendors.
92      </para>
93     </listitem>
94
95     <listitem>
96      <para>
97       <application>tar</application> is required to unpack the source
98       distribution, in addition to either
99       <application>gzip</application> or <application>bzip2</application>.
100      </para>
101     </listitem>
102
103     <listitem>
104      <para>
105       <indexterm>
106        <primary>readline</primary>
107       </indexterm>
108       <indexterm>
109        <primary>libedit</primary>
110       </indexterm>
111
112       The <acronym>GNU</acronym> <productname>Readline</productname> library is used by
113       default.  It allows <application>psql</application> (the
114       PostgreSQL command line SQL interpreter) to remember each
115       command you type, and allows you to use arrow keys to recall and
116       edit previous commands.  This is very helpful and is strongly
117       recommended.  If you don't want to use it then you must specify
118       the <option>--without-readline</option> option to
119       <filename>configure</filename>. As an alternative, you can often use the
120       BSD-licensed <filename>libedit</filename> library, originally
121       developed on <productname>NetBSD</productname>. The
122       <filename>libedit</filename> library is
123       GNU <productname>Readline</productname>-compatible and is used if
124       <filename>libreadline</filename> is not found, or if
125       <option>--with-libedit-preferred</option> is used as an
126       option to <filename>configure</filename>. If you are using a package-based
127       Linux distribution, be aware that you need both the
128       <literal>readline</literal> and <literal>readline-devel</literal> packages, if
129       those are separate in your distribution.
130      </para>
131     </listitem>
132
133     <listitem>
134      <para>
135       <indexterm>
136        <primary>zlib</primary>
137       </indexterm>
138
139       The <productname>zlib</productname> compression library is
140       used by default. If you don't want to use it then you must
141       specify the <option>--without-zlib</option> option to
142       <filename>configure</filename>. Using this option disables
143       support for compressed archives in <application>pg_dump</application> and
144       <application>pg_restore</application>.
145      </para>
146     </listitem>
147    </itemizedlist>
148   </para>
149
150   <para>
151    The following packages are optional.  They are not required in the
152    default configuration, but they are needed when certain build
153    options are enabled, as explained below:
154
155    <itemizedlist>
156     <listitem>
157      <para>
158       To build the server programming language
159       <application>PL/Perl</application> you need a full
160       <productname>Perl</productname> installation, including the
161       <filename>libperl</filename> library and the header files.
162       The minimum required version is <productname>Perl</productname> 5.8.3.
163       Since <application>PL/Perl</application> will be a shared
164       library, the <indexterm><primary>libperl</primary></indexterm>
165       <filename>libperl</filename> library must be a shared library
166       also on most platforms.  This appears to be the default in
167       recent <productname>Perl</productname> versions, but it was not
168       in earlier versions, and in any case it is the choice of whomever
169       installed Perl at your site.  <filename>configure</filename> will fail
170       if building <application>PL/Perl</application> is selected but it cannot
171       find a shared <filename>libperl</filename>.  In that case, you will have
172       to rebuild and install <productname>Perl</productname> manually to be
173       able to build <application>PL/Perl</application>.  During the
174       configuration process for <productname>Perl</productname>, request a
175       shared library.
176      </para>
177
178      <para>
179       If you intend to make more than incidental use of
180       <application>PL/Perl</application>, you should ensure that the
181       <productname>Perl</productname> installation was built with the
182       <literal>usemultiplicity</literal> option enabled (<literal>perl -V</literal>
183       will show whether this is the case).
184      </para>
185     </listitem>
186
187     <listitem>
188      <para>
189       To build the <application>PL/Python</application> server programming
190       language, you need a <productname>Python</productname>
191       installation with the header files and
192       the <application>distutils</application> module.  The minimum
193       required version is <productname>Python</productname> 2.4.
194       <productname>Python 3</productname> is supported if it's
195       version 3.1 or later; but see
196       <xref linkend="plpython-python23"/>
197       when using Python 3.
198      </para>
199
200      <para>
201       Since <application>PL/Python</application> will be a shared
202       library, the <indexterm><primary>libpython</primary></indexterm>
203       <filename>libpython</filename> library must be a shared library
204       also on most platforms.  This is not the case in a default
205       <productname>Python</productname> installation built from source, but a
206       shared library is available in many operating system
207       distributions.  <filename>configure</filename> will fail if
208       building <application>PL/Python</application> is selected but it cannot
209       find a shared <filename>libpython</filename>.  That might mean that you
210       either have to install additional packages or rebuild (part of) your
211       <productname>Python</productname> installation to provide this shared
212       library.  When building from source, run <productname>Python</productname>'s
213       configure with the <literal>--enable-shared</literal> flag.
214      </para>
215     </listitem>
216
217     <listitem>
218      <para>
219       To build the <application>PL/Tcl</application>
220       procedural language, you of course need a <productname>Tcl</productname>
221       installation.  The minimum required version is
222       <productname>Tcl</productname> 8.4.
223      </para>
224     </listitem>
225
226     <listitem>
227      <para>
228       To enable Native Language Support (<acronym>NLS</acronym>), that
229       is, the ability to display a program's messages in a language
230       other than English, you need an implementation of the
231       <application>Gettext</application> <acronym>API</acronym>.  Some operating
232       systems have this built-in (e.g., <systemitem
233       class="osname">Linux</systemitem>, <systemitem class="osname">NetBSD</systemitem>,
234       <systemitem class="osname">Solaris</systemitem>), for other systems you
235       can download an add-on package from <ulink
236       url="http://www.gnu.org/software/gettext/"></ulink>.
237       If you are using the <application>Gettext</application> implementation in
238       the <acronym>GNU</acronym> C library then you will additionally
239       need the <productname>GNU Gettext</productname> package for some
240       utility programs.  For any of the other implementations you will
241       not need it.
242      </para>
243     </listitem>
244
245     <listitem>
246      <para>
247       You need <productname>OpenSSL</productname>, if you want to support
248       encrypted client connections. The minimum required version is
249       0.9.8.
250      </para>
251     </listitem>
252
253     <listitem>
254      <para>
255       You need <application>Kerberos</application>, <productname>OpenLDAP</productname>,
256       and/or <application>PAM</application>, if you want to support authentication
257       using those services.
258      </para>
259     </listitem>
260
261     <listitem>
262      <para>
263       To build the <productname>PostgreSQL</productname> documentation,
264       there is a separate set of requirements; see
265       <xref linkend="docguide-toolsets"/>.
266      </para>
267     </listitem>
268    </itemizedlist>
269   </para>
270
271   <para>
272    If you are building from a <productname>Git</productname> tree instead of
273    using a released source package, or if you want to do server development,
274    you also need the following packages:
275
276    <itemizedlist>
277     <listitem>
278      <para>
279       <indexterm>
280        <primary>flex</primary>
281       </indexterm>
282       <indexterm>
283        <primary>lex</primary>
284       </indexterm>
285       <indexterm>
286        <primary>bison</primary>
287       </indexterm>
288       <indexterm>
289        <primary>yacc</primary>
290       </indexterm>
291
292       <application>Flex</application> and <application>Bison</application>
293       are needed to build from a Git checkout, or if you changed the actual
294       scanner and parser definition files. If you need them, be sure
295       to get <application>Flex</application> 2.5.31 or later and
296       <application>Bison</application> 1.875 or later. Other <application>lex</application>
297       and <application>yacc</application> programs cannot be used.
298      </para>
299     </listitem>
300     <listitem>
301      <para>
302       <indexterm>
303        <primary>perl</primary>
304       </indexterm>
305
306       <application>Perl</application> 5.8.3 or later is needed to build from a Git checkout,
307       or if you changed the input files for any of the build steps that
308       use Perl scripts.  If building on Windows you will need
309       <application>Perl</application> in any case.  <application>Perl</application> is
310       also required to run some test suites.
311      </para>
312     </listitem>
313    </itemizedlist>
314   </para>
315
316   <para>
317    If you need to get a <acronym>GNU</acronym> package, you can find
318    it at your local <acronym>GNU</acronym> mirror site (see <ulink
319    url="https://www.gnu.org/prep/ftp"></ulink>
320    for a list) or at <ulink
321    url="ftp://ftp.gnu.org/gnu/"></ulink>.
322   </para>
323
324   <para>
325    Also check that you have sufficient disk space. You will need about
326    100 MB for the source tree during compilation and about 20 MB for
327    the installation directory. An empty database cluster takes about
328    35 MB; databases take about five times the amount of space that a
329    flat text file with the same data would take. If you are going to
330    run the regression tests you will temporarily need up to an extra
331    150 MB. Use the <command>df</command> command to check free disk
332    space.
333   </para>
334  </sect1>
335
336  <sect1 id="install-getsource">
337   <title>Getting The Source</title>
338
339   <para>
340    The <productname>PostgreSQL</productname> &version; sources can be obtained from the
341    download section of our
342    website: <ulink url="https://www.postgresql.org/download/"></ulink>.  You
343    should get a file named <filename>postgresql-&version;.tar.gz</filename>
344    or <filename>postgresql-&version;.tar.bz2</filename>. After
345    you have obtained the file, unpack it:
346 <screen>
347 <userinput>gunzip postgresql-&version;.tar.gz</userinput>
348 <userinput>tar xf postgresql-&version;.tar</userinput>
349 </screen>
350    (Use <command>bunzip2</command> instead of <command>gunzip</command> if you
351    have the <filename>.bz2</filename> file.)
352    This will create a directory
353    <filename>postgresql-&version;</filename> under the current directory
354    with the <productname>PostgreSQL</productname> sources.
355    Change into that directory for the rest
356    of the installation procedure.
357   </para>
358
359   <para>
360    You can also get the source directly from the version control repository, see
361    <xref linkend="sourcerepo"/>.
362   </para>
363  </sect1>
364
365  <sect1 id="install-procedure">
366   <title>Installation Procedure</title>
367
368   <procedure>
369
370   <step id="configure">
371    <title>Configuration</title>
372
373    <indexterm zone="configure">
374     <primary>configure</primary>
375    </indexterm>
376
377    <para>
378     The first step of the installation procedure is to configure the
379     source tree for your system and choose the options you would like.
380     This is done by running the <filename>configure</filename> script. For a
381     default installation simply enter:
382 <screen>
383 <userinput>./configure</userinput>
384 </screen>
385     This script will run a number of tests to determine values for various
386     system dependent variables and detect any quirks of your
387     operating system, and finally will create several files in the
388     build tree to record what it found.  You can also run
389     <filename>configure</filename> in a directory outside the source
390     tree, if you want to keep the build directory separate.  This
391     procedure is also called a
392     <indexterm><primary>VPATH</primary></indexterm><firstterm>VPATH</firstterm>
393     build.  Here's how:
394 <screen>
395 <userinput>mkdir build_dir</userinput>
396 <userinput>cd build_dir</userinput>
397 <userinput>/path/to/source/tree/configure [options go here]</userinput>
398 <userinput>make</userinput>
399 </screen>
400    </para>
401
402    <para>
403     The default configuration will build the server and utilities, as
404     well as all client applications and interfaces that require only a
405     C compiler. All files will be installed under
406     <filename>/usr/local/pgsql</filename> by default.
407    </para>
408
409    <para>
410     You can customize the build and installation process by supplying one
411     or more of the following command line options to
412     <filename>configure</filename>:
413
414      <variablelist>
415       <varlistentry>
416        <term><option>--prefix=<replaceable>PREFIX</replaceable></option></term>
417        <listitem>
418         <para>
419          Install all files under the directory <replaceable>PREFIX</replaceable>
420          instead of <filename>/usr/local/pgsql</filename>. The actual
421          files will be installed into various subdirectories; no files
422          will ever be installed directly into the
423          <replaceable>PREFIX</replaceable> directory.
424         </para>
425
426         <para>
427          If you have special needs, you can also customize the
428          individual subdirectories with the following options. However,
429          if you leave these with their defaults, the installation will be
430          relocatable, meaning you can move the directory after
431          installation. (The <literal>man</literal> and <literal>doc</literal>
432          locations are not affected by this.)
433         </para>
434
435         <para>
436          For relocatable installs, you might want to use
437          <filename>configure</filename>'s <literal>--disable-rpath</literal>
438          option.  Also, you will need to tell the operating system how
439          to find the shared libraries.
440         </para>
441        </listitem>
442       </varlistentry>
443
444       <varlistentry>
445        <term><option>--exec-prefix=<replaceable>EXEC-PREFIX</replaceable></option></term>
446        <listitem>
447         <para>
448          You can install architecture-dependent files under a
449          different prefix, <replaceable>EXEC-PREFIX</replaceable>, than what
450          <replaceable>PREFIX</replaceable> was set to. This can be useful to
451          share architecture-independent files between hosts. If you
452          omit this, then <replaceable>EXEC-PREFIX</replaceable> is set equal to
453          <replaceable>PREFIX</replaceable> and both architecture-dependent and
454          independent files will be installed under the same tree,
455          which is probably what you want.
456         </para>
457        </listitem>
458       </varlistentry>
459
460       <varlistentry>
461        <term><option>--bindir=<replaceable>DIRECTORY</replaceable></option></term>
462        <listitem>
463         <para>
464          Specifies the directory for executable programs. The default
465          is <filename><replaceable>EXEC-PREFIX</replaceable>/bin</filename>, which
466          normally means <filename>/usr/local/pgsql/bin</filename>.
467         </para>
468        </listitem>
469       </varlistentry>
470
471       <varlistentry>
472        <term><option>--sysconfdir=<replaceable>DIRECTORY</replaceable></option></term>
473        <listitem>
474         <para>
475          Sets the directory for various configuration files,
476          <filename><replaceable>PREFIX</replaceable>/etc</filename> by default.
477         </para>
478        </listitem>
479       </varlistentry>
480
481       <varlistentry>
482        <term><option>--libdir=<replaceable>DIRECTORY</replaceable></option></term>
483        <listitem>
484         <para>
485          Sets the location to install libraries and dynamically loadable
486          modules. The default is
487          <filename><replaceable>EXEC-PREFIX</replaceable>/lib</filename>.
488         </para>
489        </listitem>
490       </varlistentry>
491
492       <varlistentry>
493        <term><option>--includedir=<replaceable>DIRECTORY</replaceable></option></term>
494        <listitem>
495         <para>
496          Sets the directory for installing C and C++ header files. The
497          default is <filename><replaceable>PREFIX</replaceable>/include</filename>.
498         </para>
499        </listitem>
500       </varlistentry>
501
502       <varlistentry>
503        <term><option>--datarootdir=<replaceable>DIRECTORY</replaceable></option></term>
504        <listitem>
505         <para>
506          Sets the root directory for various types of read-only data
507          files.  This only sets the default for some of the following
508          options.  The default is
509          <filename><replaceable>PREFIX</replaceable>/share</filename>.
510         </para>
511        </listitem>
512       </varlistentry>
513
514       <varlistentry>
515        <term><option>--datadir=<replaceable>DIRECTORY</replaceable></option></term>
516        <listitem>
517         <para>
518          Sets the directory for read-only data files used by the
519          installed programs. The default is
520          <filename><replaceable>DATAROOTDIR</replaceable></filename>. Note that this has
521          nothing to do with where your database files will be placed.
522         </para>
523        </listitem>
524       </varlistentry>
525
526       <varlistentry>
527        <term><option>--localedir=<replaceable>DIRECTORY</replaceable></option></term>
528        <listitem>
529         <para>
530          Sets the directory for installing locale data, in particular
531          message translation catalog files.  The default is
532          <filename><replaceable>DATAROOTDIR</replaceable>/locale</filename>.
533         </para>
534        </listitem>
535       </varlistentry>
536
537       <varlistentry>
538        <term><option>--mandir=<replaceable>DIRECTORY</replaceable></option></term>
539        <listitem>
540         <para>
541          The man pages that come with <productname>PostgreSQL</productname> will be installed under
542          this directory, in their respective
543          <filename>man<replaceable>x</replaceable></filename> subdirectories.
544          The default is <filename><replaceable>DATAROOTDIR</replaceable>/man</filename>.
545         </para>
546        </listitem>
547       </varlistentry>
548
549       <varlistentry>
550        <term><option>--docdir=<replaceable>DIRECTORY</replaceable></option></term>
551        <listitem>
552         <para>
553          Sets the root directory for installing documentation files,
554          except <quote>man</quote> pages.  This only sets the default for
555          the following options.  The default value for this option is
556          <filename><replaceable>DATAROOTDIR</replaceable>/doc/postgresql</filename>.
557         </para>
558        </listitem>
559       </varlistentry>
560
561       <varlistentry>
562        <term><option>--htmldir=<replaceable>DIRECTORY</replaceable></option></term>
563        <listitem>
564         <para>
565          The HTML-formatted documentation for
566          <productname>PostgreSQL</productname> will be installed under
567          this directory.  The default is
568          <filename><replaceable>DATAROOTDIR</replaceable></filename>.
569         </para>
570        </listitem>
571       </varlistentry>
572      </variablelist>
573
574      <note>
575       <para>
576        Care has been taken to make it possible to install
577        <productname>PostgreSQL</productname> into shared installation locations
578        (such as <filename>/usr/local/include</filename>) without
579        interfering with the namespace of the rest of the system. First,
580        the string <quote><literal>/postgresql</literal></quote> is
581        automatically appended to <varname>datadir</varname>,
582        <varname>sysconfdir</varname>, and <varname>docdir</varname>,
583        unless the fully expanded directory name already contains the
584        string <quote><literal>postgres</literal></quote> or
585        <quote><literal>pgsql</literal></quote>. For example, if you choose
586        <filename>/usr/local</filename> as prefix, the documentation will
587        be installed in <filename>/usr/local/doc/postgresql</filename>,
588        but if the prefix is <filename>/opt/postgres</filename>, then it
589        will be in <filename>/opt/postgres/doc</filename>. The public C
590        header files of the client interfaces are installed into
591        <varname>includedir</varname> and are namespace-clean. The
592        internal header files and the server header files are installed
593        into private directories under <varname>includedir</varname>. See
594        the documentation of each interface for information about how to
595        access its header files. Finally, a private subdirectory will
596        also be created, if appropriate, under <varname>libdir</varname>
597        for dynamically loadable modules.
598       </para>
599      </note>
600     </para>
601
602     <para>
603      <variablelist>
604       <varlistentry>
605        <term><option>--with-extra-version=<replaceable>STRING</replaceable></option></term>
606        <listitem>
607         <para>
608          Append <replaceable>STRING</replaceable> to the PostgreSQL version number.  You
609          can use this, for example, to mark binaries built from unreleased Git
610          snapshots or containing custom patches with an extra version string
611          such as a <command>git describe</command> identifier or a
612          distribution package release number.
613         </para>
614        </listitem>
615       </varlistentry>
616
617       <varlistentry>
618        <term><option>--with-includes=<replaceable>DIRECTORIES</replaceable></option></term>
619        <listitem>
620         <para>
621          <replaceable>DIRECTORIES</replaceable> is a colon-separated list of
622          directories that will be added to the list the compiler
623          searches for header files. If you have optional packages
624          (such as GNU <application>Readline</application>) installed in a non-standard
625          location,
626          you have to use this option and probably also the corresponding
627          <option>--with-libraries</option> option.
628         </para>
629         <para>
630          Example: <literal>--with-includes=/opt/gnu/include:/usr/sup/include</literal>.
631         </para>
632        </listitem>
633       </varlistentry>
634
635       <varlistentry>
636        <term><option>--with-libraries=<replaceable>DIRECTORIES</replaceable></option></term>
637        <listitem>
638         <para>
639          <replaceable>DIRECTORIES</replaceable> is a colon-separated list of
640          directories to search for libraries. You will probably have
641          to use this option (and the corresponding
642          <option>--with-includes</option> option) if you have packages
643          installed in non-standard locations.
644         </para>
645         <para>
646          Example: <literal>--with-libraries=/opt/gnu/lib:/usr/sup/lib</literal>.
647         </para>
648        </listitem>
649       </varlistentry>
650
651       <varlistentry>
652        <term><option>--enable-nls<optional>=<replaceable>LANGUAGES</replaceable></optional></option></term>
653        <listitem>
654         <para>
655          Enables Native Language Support (<acronym>NLS</acronym>),
656          that is, the ability to display a program's messages in a
657          language other than English.
658          <replaceable>LANGUAGES</replaceable> is an optional space-separated
659          list of codes of the languages that you want supported, for
660          example <literal>--enable-nls='de fr'</literal>.  (The intersection
661          between your list and the set of actually provided
662          translations will be computed automatically.)  If you do not
663          specify a list, then all available translations are
664          installed.
665         </para>
666
667         <para>
668          To use this option, you will need an implementation of the
669          <application>Gettext</application> API; see above.
670         </para>
671        </listitem>
672       </varlistentry>
673
674       <varlistentry>
675        <term><option>--with-pgport=<replaceable>NUMBER</replaceable></option></term>
676        <listitem>
677         <para>
678          Set <replaceable>NUMBER</replaceable> as the default port number for
679          server and clients. The default is 5432. The port can always
680          be changed later on, but if you specify it here then both
681          server and clients will have the same default compiled in,
682          which can be very convenient.  Usually the only good reason
683          to select a non-default value is if you intend to run multiple
684          <productname>PostgreSQL</productname> servers on the same machine.
685         </para>
686        </listitem>
687       </varlistentry>
688
689       <varlistentry>
690        <term><option>--with-perl</option></term>
691        <listitem>
692         <para>
693          Build the <application>PL/Perl</application> server-side language.
694         </para>
695        </listitem>
696       </varlistentry>
697
698       <varlistentry>
699        <term><option>--with-python</option></term>
700        <listitem>
701         <para>
702          Build the <application>PL/Python</application> server-side language.
703         </para>
704        </listitem>
705       </varlistentry>
706
707       <varlistentry>
708        <term><option>--with-tcl</option></term>
709        <listitem>
710         <para>
711          Build the <application>PL/Tcl</application> server-side language.
712         </para>
713        </listitem>
714       </varlistentry>
715
716       <varlistentry>
717        <term><option>--with-tclconfig=<replaceable>DIRECTORY</replaceable></option></term>
718        <listitem>
719         <para>
720          Tcl installs the file <filename>tclConfig.sh</filename>, which
721          contains configuration information needed to build modules
722          interfacing to Tcl. This file is normally found automatically
723          at a well-known location, but if you want to use a different
724          version of Tcl you can specify the directory in which to look
725          for it.
726         </para>
727        </listitem>
728       </varlistentry>
729
730       <varlistentry>
731        <term><option>--with-gssapi</option></term>
732        <listitem>
733         <para>
734          Build with support for GSSAPI authentication. On many
735          systems, the GSSAPI (usually a part of the Kerberos installation)
736          system is not installed in a location
737          that is searched by default (e.g., <filename>/usr/include</filename>,
738          <filename>/usr/lib</filename>), so you must use the options
739          <option>--with-includes</option> and <option>--with-libraries</option> in
740          addition to this option.  <filename>configure</filename> will check
741          for the required header files and libraries to make sure that
742          your GSSAPI installation is sufficient before proceeding.
743         </para>
744        </listitem>
745       </varlistentry>
746
747       <varlistentry>
748        <term><option>--with-krb-srvnam=<replaceable>NAME</replaceable></option></term>
749        <listitem>
750         <para>
751          The default name of the Kerberos service principal used
752          by GSSAPI.
753          <literal>postgres</literal> is the default. There's usually no
754          reason to change this unless you have a Windows environment,
755          in which case it must be set to upper case
756          <literal>POSTGRES</literal>.
757         </para>
758        </listitem>
759       </varlistentry>
760
761       <varlistentry id="configure-with-llvm">
762        <term><option>--with-llvm</option></term>
763        <listitem>
764         <para>
765          Build with support for <productname>LLVM</productname> based
766          <acronym>JIT</acronym> compilation<phrase
767          condition="standalone-ignore"> (see <xref
768          linkend="jit"/>)</phrase>.  This
769          requires the <productname>LLVM</productname> library to be installed.
770          The minimum required version of <productname>LLVM</productname> is
771          currently 3.9.
772         </para>
773         <para>
774          <command>llvm-config</command><indexterm><primary>llvm-config</primary></indexterm>
775          will be used to find the required compilation options.
776          <command>llvm-config</command>, and then
777          <command>llvm-config-$major-$minor</command> for all supported
778          versions, will be searched on <envar>PATH</envar>. If that would not
779          yield the correct binary, use <envar>LLVM_CONFIG</envar> to specify a
780          path to the correct <command>llvm-config</command>. For example
781 <programlisting>
782 ./configure ... --with-llvm LLVM_CONFIG='/path/to/llvm/bin/llvm-config'
783 </programlisting>
784         </para>
785
786         <para>
787          <productname>LLVM</productname> support requires a compatible
788          <command>clang</command> compiler (specified, if necessary, using the
789          <envar>CLANG</envar> environment variable), and a working C++
790          compiler (specified, if necessary, using the <envar>CXX</envar>
791          environment variable).
792         </para>
793        </listitem>
794       </varlistentry>
795
796       <varlistentry>
797        <term><option>--with-icu</option></term>
798        <listitem>
799         <para>
800          Build with support for
801          the <productname>ICU</productname><indexterm><primary>ICU</primary></indexterm>
802          library.  This requires the <productname>ICU4C</productname> package
803          to be installed.  The minimum required version
804          of <productname>ICU4C</productname> is currently 4.2.
805         </para>
806
807         <para>
808          By default,
809          <productname>pkg-config</productname><indexterm><primary>pkg-config</primary></indexterm>
810          will be used to find the required compilation options.  This is
811          supported for <productname>ICU4C</productname> version 4.6 and later.
812          For older versions, or if <productname>pkg-config</productname> is
813          not available, the variables <envar>ICU_CFLAGS</envar>
814          and <envar>ICU_LIBS</envar> can be specified
815          to <filename>configure</filename>, like in this example:
816 <programlisting>
817 ./configure ... --with-icu ICU_CFLAGS='-I/some/where/include' ICU_LIBS='-L/some/where/lib -licui18n -licuuc -licudata'
818 </programlisting>
819          (If <productname>ICU4C</productname> is in the default search path
820          for the compiler, then you still need to specify a nonempty string in
821          order to avoid use of <productname>pkg-config</productname>, for
822          example, <literal>ICU_CFLAGS=' '</literal>.)
823         </para>
824        </listitem>
825       </varlistentry>
826
827       <varlistentry>
828        <term><option>--with-openssl</option>
829        <indexterm>
830         <primary>OpenSSL</primary>
831         <seealso>SSL</seealso>
832        </indexterm>
833        </term>
834        <listitem>
835         <para>
836          Build with support for <acronym>SSL</acronym> (encrypted)
837          connections. This requires the <productname>OpenSSL</productname>
838          package to be installed.  <filename>configure</filename> will check
839          for the required header files and libraries to make sure that
840          your <productname>OpenSSL</productname> installation is sufficient
841          before proceeding.
842         </para>
843        </listitem>
844       </varlistentry>
845
846       <varlistentry>
847        <term><option>--with-pam</option></term>
848        <listitem>
849         <para>
850          Build with <acronym>PAM</acronym><indexterm><primary>PAM</primary></indexterm>
851          (Pluggable Authentication Modules) support.
852         </para>
853        </listitem>
854       </varlistentry>
855
856       <varlistentry>
857        <term><option>--with-bsd-auth</option></term>
858        <listitem>
859         <para>
860          Build with BSD Authentication support.
861          (The BSD Authentication framework is
862          currently only available on OpenBSD.)
863         </para>
864        </listitem>
865       </varlistentry>
866
867       <varlistentry>
868        <term><option>--with-ldap</option></term>
869        <listitem>
870         <para>
871          Build with <acronym>LDAP</acronym><indexterm><primary>LDAP</primary></indexterm>
872          support for authentication and connection parameter lookup (see
873          <phrase id="install-ldap-links"><xref linkend="libpq-ldap"/> and
874          <xref linkend="auth-ldap"/></phrase> for more information). On Unix,
875          this requires the <productname>OpenLDAP</productname> package to be
876          installed. On Windows, the default <productname>WinLDAP</productname>
877          library is used.  <filename>configure</filename> will check for the required
878          header files and libraries to make sure that your
879          <productname>OpenLDAP</productname> installation is sufficient before
880          proceeding.
881         </para>
882        </listitem>
883       </varlistentry>
884
885       <varlistentry>
886        <term><option>--with-systemd</option></term>
887        <listitem>
888         <para>
889          Build with support
890          for <application>systemd</application><indexterm><primary>systemd</primary></indexterm>
891          service notifications.  This improves integration if the server binary
892          is started under <application>systemd</application> but has no impact
893          otherwise<phrase condition="standalone-ignore">; see <xref linkend="server-start"/> for more
894          information</phrase>.  <application>libsystemd</application> and the
895          associated header files need to be installed to be able to use this
896          option.
897         </para>
898        </listitem>
899       </varlistentry>
900
901       <varlistentry>
902        <term><option>--without-readline</option></term>
903        <listitem>
904         <para>
905          Prevents use of the <application>Readline</application> library
906          (and <application>libedit</application> as well).  This option disables
907          command-line editing and history in
908          <application>psql</application>, so it is not recommended.
909         </para>
910        </listitem>
911       </varlistentry>
912
913       <varlistentry>
914        <term><option>--with-libedit-preferred</option></term>
915        <listitem>
916         <para>
917          Favors the use of the BSD-licensed <application>libedit</application> library
918          rather than GPL-licensed <application>Readline</application>.  This option
919          is significant only if you have both libraries installed; the
920          default in that case is to use <application>Readline</application>.
921         </para>
922        </listitem>
923       </varlistentry>
924
925       <varlistentry>
926        <term><option>--with-bonjour</option></term>
927        <listitem>
928         <para>
929          Build with Bonjour support.  This requires Bonjour support
930          in your operating system.  Recommended on macOS.
931         </para>
932        </listitem>
933       </varlistentry>
934
935       <varlistentry>
936        <term><option>--with-uuid=<replaceable>LIBRARY</replaceable></option></term>
937        <listitem>
938         <para>
939          Build the <xref linkend="uuid-ossp"/> module
940          (which provides functions to generate UUIDs), using the specified
941          UUID library.<indexterm><primary>UUID</primary></indexterm>
942          <replaceable>LIBRARY</replaceable> must be one of:
943         </para>
944         <itemizedlist>
945          <listitem>
946           <para>
947            <option>bsd</option> to use the UUID functions found in FreeBSD, NetBSD,
948            and some other BSD-derived systems
949           </para>
950          </listitem>
951          <listitem>
952           <para>
953            <option>e2fs</option> to use the UUID library created by
954            the <literal>e2fsprogs</literal> project; this library is present in most
955            Linux systems and in macOS, and can be obtained for other
956            platforms as well
957           </para>
958          </listitem>
959          <listitem>
960           <para>
961            <option>ossp</option> to use the <ulink
962            url="http://www.ossp.org/pkg/lib/uuid/">OSSP UUID library</ulink>
963           </para>
964          </listitem>
965         </itemizedlist>
966        </listitem>
967       </varlistentry>
968
969       <varlistentry>
970        <term><option>--with-ossp-uuid</option></term>
971        <listitem>
972         <para>
973          Obsolete equivalent of <literal>--with-uuid=ossp</literal>.
974         </para>
975        </listitem>
976       </varlistentry>
977
978       <varlistentry>
979        <term><option>--with-libxml</option></term>
980        <listitem>
981         <para>
982          Build with libxml (enables SQL/XML support).  Libxml version 2.6.23 or
983          later is required for this feature.
984         </para>
985
986         <para>
987          Libxml installs a program <command>xml2-config</command> that
988          can be used to detect the required compiler and linker
989          options.  PostgreSQL will use it automatically if found.  To
990          specify a libxml installation at an unusual location, you can
991          either set the environment variable
992          <envar>XML2_CONFIG</envar> to point to the
993          <command>xml2-config</command> program belonging to the
994          installation, or use the options
995          <option>--with-includes</option> and
996          <option>--with-libraries</option>.
997         </para>
998        </listitem>
999       </varlistentry>
1000
1001       <varlistentry>
1002        <term><option>--with-libxslt</option></term>
1003        <listitem>
1004         <para>
1005          Use libxslt when building the
1006          <xref linkend="xml2"/>
1007          module.  <application>xml2</application> relies on this library
1008          to perform XSL transformations of XML.
1009         </para>
1010        </listitem>
1011       </varlistentry>
1012
1013       <varlistentry>
1014        <term><option>--disable-float4-byval</option></term>
1015        <listitem>
1016         <para>
1017          Disable passing float4 values <quote>by value</quote>, causing them
1018          to be passed <quote>by reference</quote> instead.  This option costs
1019          performance, but may be needed for compatibility with old
1020          user-defined functions that are written in C and use the
1021          <quote>version 0</quote> calling convention.  A better long-term
1022          solution is to update any such functions to use the
1023          <quote>version 1</quote> calling convention.
1024         </para>
1025        </listitem>
1026       </varlistentry>
1027
1028       <varlistentry>
1029        <term><option>--disable-float8-byval</option></term>
1030        <listitem>
1031         <para>
1032          Disable passing float8 values <quote>by value</quote>, causing them
1033          to be passed <quote>by reference</quote> instead.  This option costs
1034          performance, but may be needed for compatibility with old
1035          user-defined functions that are written in C and use the
1036          <quote>version 0</quote> calling convention.  A better long-term
1037          solution is to update any such functions to use the
1038          <quote>version 1</quote> calling convention.
1039          Note that this option affects not only float8, but also int8 and some
1040          related types such as timestamp.
1041          On 32-bit platforms, <option>--disable-float8-byval</option> is the default
1042          and it is not allowed to select <option>--enable-float8-byval</option>.
1043         </para>
1044        </listitem>
1045       </varlistentry>
1046
1047       <varlistentry>
1048        <term><option>--with-segsize=<replaceable>SEGSIZE</replaceable></option></term>
1049        <listitem>
1050         <para>
1051          Set the <firstterm>segment size</firstterm>, in gigabytes.  Large tables are
1052          divided into multiple operating-system files, each of size equal
1053          to the segment size.  This avoids problems with file size limits
1054          that exist on many platforms.  The default segment size, 1 gigabyte,
1055          is safe on all supported platforms.  If your operating system has
1056          <quote>largefile</quote> support (which most do, nowadays), you can use
1057          a larger segment size.  This can be helpful to reduce the number of
1058          file descriptors consumed when working with very large tables.
1059          But be careful not to select a value larger than is supported
1060          by your platform and the file systems you intend to use.  Other
1061          tools you might wish to use, such as <application>tar</application>, could
1062          also set limits on the usable file size.
1063          It is recommended, though not absolutely required, that this value
1064          be a power of 2.
1065          Note that changing this value requires an initdb.
1066         </para>
1067        </listitem>
1068       </varlistentry>
1069
1070       <varlistentry>
1071        <term><option>--with-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
1072        <listitem>
1073         <para>
1074          Set the <firstterm>block size</firstterm>, in kilobytes.  This is the unit
1075          of storage and I/O within tables.  The default, 8 kilobytes,
1076          is suitable for most situations; but other values may be useful
1077          in special cases.
1078          The value must be a power of 2 between 1 and 32 (kilobytes).
1079          Note that changing this value requires an initdb.
1080         </para>
1081        </listitem>
1082       </varlistentry>
1083
1084       <varlistentry>
1085        <term><option>--with-wal-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
1086        <listitem>
1087         <para>
1088          Set the <firstterm>WAL block size</firstterm>, in kilobytes.  This is the unit
1089          of storage and I/O within the WAL log.  The default, 8 kilobytes,
1090          is suitable for most situations; but other values may be useful
1091          in special cases.
1092          The value must be a power of 2 between 1 and 64 (kilobytes).
1093          Note that changing this value requires an initdb.
1094         </para>
1095        </listitem>
1096       </varlistentry>
1097
1098       <varlistentry>
1099        <term><option>--disable-spinlocks</option></term>
1100        <listitem>
1101         <para>
1102          Allow the build to succeed even if <productname>PostgreSQL</productname>
1103          has no CPU spinlock support for the platform.  The lack of
1104          spinlock support will result in poor performance; therefore,
1105          this option should only be used if the build aborts and
1106          informs you that the platform lacks spinlock support. If this
1107          option is required to build <productname>PostgreSQL</productname> on
1108          your platform, please report the problem to the
1109          <productname>PostgreSQL</productname> developers.
1110         </para>
1111        </listitem>
1112       </varlistentry>
1113
1114       <varlistentry>
1115        <term><option>--disable-strong-random</option></term>
1116        <listitem>
1117         <para>
1118          Allow the build to succeed even if <productname>PostgreSQL</productname>
1119          has no support for strong random numbers on the platform.
1120          A source of random numbers is needed for some authentication
1121          protocols, as well as some routines in the
1122          <xref linkend="pgcrypto"/>
1123          module. <option>--disable-strong-random</option> disables functionality that
1124          requires cryptographically strong random numbers, and substitutes
1125          a weak pseudo-random-number-generator for the generation of
1126          authentication salt values and query cancel keys. It may make
1127          authentication less secure.
1128         </para>
1129        </listitem>
1130       </varlistentry>
1131
1132       <varlistentry>
1133        <term><option>--disable-thread-safety</option></term>
1134        <listitem>
1135         <para>
1136          Disable the thread-safety of client libraries.  This prevents
1137          concurrent threads in <application>libpq</application> and
1138          <application>ECPG</application> programs from safely controlling
1139          their private connection handles.
1140         </para>
1141        </listitem>
1142       </varlistentry>
1143
1144       <varlistentry>
1145        <term><option>--with-system-tzdata=<replaceable>DIRECTORY</replaceable></option>
1146        <indexterm>
1147         <primary>time zone data</primary>
1148        </indexterm>
1149        </term>
1150        <listitem>
1151         <para>
1152          <productname>PostgreSQL</productname> includes its own time zone database,
1153          which it requires for date and time operations.  This time zone
1154          database is in fact compatible with the IANA time zone
1155          database provided by many operating systems such as FreeBSD,
1156          Linux, and Solaris, so it would be redundant to install it again.
1157          When this option is used, the system-supplied time zone database
1158          in <replaceable>DIRECTORY</replaceable> is used instead of the one
1159          included in the PostgreSQL source distribution.
1160          <replaceable>DIRECTORY</replaceable> must be specified as an
1161          absolute path.  <filename>/usr/share/zoneinfo</filename> is a
1162          likely directory on some operating systems.  Note that the
1163          installation routine will not detect mismatching or erroneous time
1164          zone data.  If you use this option, you are advised to run the
1165          regression tests to verify that the time zone data you have
1166          pointed to works correctly with <productname>PostgreSQL</productname>.
1167         </para>
1168
1169         <indexterm><primary>cross compilation</primary></indexterm>
1170
1171         <para>
1172          This option is mainly aimed at binary package distributors
1173          who know their target operating system well.  The main
1174          advantage of using this option is that the PostgreSQL package
1175          won't need to be upgraded whenever any of the many local
1176          daylight-saving time rules change.  Another advantage is that
1177          PostgreSQL can be cross-compiled more straightforwardly if the
1178          time zone database files do not need to be built during the
1179          installation.
1180         </para>
1181        </listitem>
1182       </varlistentry>
1183
1184       <varlistentry>
1185        <term><option>--without-zlib</option></term>
1186        <listitem>
1187         <para>
1188          <indexterm>
1189           <primary>zlib</primary>
1190          </indexterm>
1191          Prevents use of the <application>Zlib</application> library.  This disables
1192          support for compressed archives in <application>pg_dump</application>
1193          and <application>pg_restore</application>.
1194          This option is only intended for those rare systems where this
1195          library is not available.
1196         </para>
1197        </listitem>
1198       </varlistentry>
1199
1200       <varlistentry>
1201        <term><option>--enable-debug</option></term>
1202        <listitem>
1203         <para>
1204          Compiles all programs and libraries with debugging symbols.
1205          This means that you can run the programs in a debugger
1206          to analyze problems. This enlarges the size of the installed
1207          executables considerably, and on non-GCC compilers it usually
1208          also disables compiler optimization, causing slowdowns. However,
1209          having the symbols available is extremely helpful for dealing
1210          with any problems that might arise.  Currently, this option is
1211          recommended for production installations only if you use GCC.
1212          But you should always have it on if you are doing development work
1213          or running a beta version.
1214         </para>
1215        </listitem>
1216       </varlistentry>
1217
1218       <varlistentry>
1219        <term><option>--enable-coverage</option></term>
1220        <listitem>
1221         <para>
1222          If using GCC, all programs and libraries are compiled with
1223          code coverage testing instrumentation.  When run, they
1224          generate files in the build directory with code coverage
1225          metrics.
1226          <phrase condition="standalone-ignore">See <xref linkend="regress-coverage"/>
1227          for more information.</phrase> This option is for use only with GCC
1228          and when doing development work.
1229         </para>
1230        </listitem>
1231       </varlistentry>
1232
1233       <varlistentry>
1234        <term><option>--enable-profiling</option></term>
1235        <listitem>
1236         <para>
1237          If using GCC, all programs and libraries are compiled so they
1238          can be profiled.  On backend exit, a subdirectory will be created
1239          that contains the <filename>gmon.out</filename> file for use in profiling.
1240          This option is for use only with GCC and when doing development work.
1241         </para>
1242        </listitem>
1243       </varlistentry>
1244
1245       <varlistentry>
1246        <term><option>--enable-cassert</option></term>
1247        <listitem>
1248         <para>
1249          Enables <firstterm>assertion</firstterm> checks in the server, which test for
1250          many <quote>cannot happen</quote> conditions.  This is invaluable for
1251          code development purposes, but the tests can slow down the
1252          server significantly.
1253          Also, having the tests turned on won't necessarily enhance the
1254          stability of your server!  The assertion checks are not categorized
1255          for severity, and so what might be a relatively harmless bug will
1256          still lead to server restarts if it triggers an assertion
1257          failure.  This option is not recommended for production use, but
1258          you should have it on for development work or when running a beta
1259          version.
1260         </para>
1261        </listitem>
1262       </varlistentry>
1263
1264       <varlistentry>
1265        <term><option>--enable-depend</option></term>
1266        <listitem>
1267         <para>
1268          Enables automatic dependency tracking.  With this option, the
1269          makefiles are set up so that all affected object files will
1270          be rebuilt when any header file is changed.  This is useful
1271          if you are doing development work, but is just wasted overhead
1272          if you intend only to compile once and install.  At present,
1273          this option only works with GCC.
1274         </para>
1275        </listitem>
1276       </varlistentry>
1277
1278       <varlistentry>
1279        <term><option>--enable-dtrace</option></term>
1280        <listitem>
1281         <para>
1282          <indexterm>
1283           <primary>DTrace</primary>
1284          </indexterm>
1285          Compiles <productname>PostgreSQL</productname> with support for the
1286          dynamic tracing tool DTrace.
1287          <phrase condition="standalone-ignore">See <xref linkend="dynamic-trace"/>
1288          for more information.</phrase>
1289         </para>
1290
1291         <para>
1292          To point to the <command>dtrace</command> program, the
1293          environment variable <envar>DTRACE</envar> can be set.  This
1294          will often be necessary because <command>dtrace</command> is
1295          typically installed under <filename>/usr/sbin</filename>,
1296          which might not be in the path.
1297         </para>
1298
1299         <para>
1300          Extra command-line options for the <command>dtrace</command> program
1301          can be specified in the environment variable
1302          <envar>DTRACEFLAGS</envar>.  On Solaris,
1303          to include DTrace support in a 64-bit binary, you must specify
1304          <literal>DTRACEFLAGS="-64"</literal> to configure.  For example,
1305          using the GCC compiler:
1306 <screen>
1307 ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
1308 </screen>
1309          Using Sun's compiler:
1310 <screen>
1311 ./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
1312 </screen>
1313         </para>
1314        </listitem>
1315       </varlistentry>
1316
1317       <varlistentry>
1318        <term><option>--enable-tap-tests</option></term>
1319        <listitem>
1320         <para>
1321          Enable tests using the Perl TAP tools.  This requires a Perl
1322          installation and the Perl module <literal>IPC::Run</literal>.
1323          <phrase condition="standalone-ignore">See <xref linkend="regress-tap"/> for more information.</phrase>
1324         </para>
1325        </listitem>
1326       </varlistentry>
1327      </variablelist>
1328     </para>
1329
1330     <para>
1331      If you prefer a C compiler different from the one
1332      <filename>configure</filename> picks, you can set the
1333      environment variable <envar>CC</envar> to the program of your choice.
1334      By default, <filename>configure</filename> will pick
1335      <filename>gcc</filename> if available, else the platform's
1336      default (usually <filename>cc</filename>).  Similarly, you can override the
1337      default compiler flags if needed with the <envar>CFLAGS</envar> variable.
1338     </para>
1339
1340     <para>
1341      You can specify environment variables on the
1342      <filename>configure</filename> command line, for example:
1343 <screen>
1344 <userinput>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</userinput>
1345 </screen>
1346     </para>
1347
1348     <para>
1349      Here is a list of the significant variables that can be set in
1350      this manner:
1351
1352      <variablelist>
1353       <varlistentry>
1354        <term><envar>BISON</envar></term>
1355        <listitem>
1356         <para>
1357          Bison program
1358         </para>
1359        </listitem>
1360       </varlistentry>
1361
1362       <varlistentry>
1363        <term><envar>CC</envar></term>
1364        <listitem>
1365         <para>
1366          C compiler
1367         </para>
1368        </listitem>
1369       </varlistentry>
1370
1371       <varlistentry>
1372        <term><envar>CFLAGS</envar></term>
1373        <listitem>
1374         <para>
1375          options to pass to the C compiler
1376         </para>
1377        </listitem>
1378       </varlistentry>
1379
1380       <varlistentry>
1381        <term><envar>CLANG</envar></term>
1382        <listitem>
1383         <para>
1384          path to <command>clang</command> program used to process source code
1385          for inlining when compiling with <literal>--with-llvm</literal>
1386         </para>
1387        </listitem>
1388       </varlistentry>
1389
1390       <varlistentry>
1391        <term><envar>CPP</envar></term>
1392        <listitem>
1393         <para>
1394          C preprocessor
1395         </para>
1396        </listitem>
1397       </varlistentry>
1398
1399       <varlistentry>
1400        <term><envar>CPPFLAGS</envar></term>
1401        <listitem>
1402         <para>
1403          options to pass to the C preprocessor
1404         </para>
1405        </listitem>
1406       </varlistentry>
1407
1408       <varlistentry>
1409        <term><envar>CXX</envar></term>
1410        <listitem>
1411         <para>
1412          C++ compiler
1413         </para>
1414        </listitem>
1415       </varlistentry>
1416
1417       <varlistentry>
1418        <term><envar>CXXFLAGS</envar></term>
1419        <listitem>
1420         <para>
1421          options to pass to the C++ compiler
1422         </para>
1423        </listitem>
1424       </varlistentry>
1425
1426       <varlistentry>
1427        <term><envar>DTRACE</envar></term>
1428        <listitem>
1429         <para>
1430          location of the <command>dtrace</command> program
1431         </para>
1432        </listitem>
1433       </varlistentry>
1434
1435       <varlistentry>
1436        <term><envar>DTRACEFLAGS</envar></term>
1437        <listitem>
1438         <para>
1439          options to pass to the <command>dtrace</command> program
1440         </para>
1441        </listitem>
1442       </varlistentry>
1443
1444       <varlistentry>
1445        <term><envar>FLEX</envar></term>
1446        <listitem>
1447         <para>
1448          Flex program
1449         </para>
1450        </listitem>
1451       </varlistentry>
1452
1453       <varlistentry>
1454        <term><envar>LDFLAGS</envar></term>
1455        <listitem>
1456         <para>
1457          options to use when linking either executables or shared libraries
1458         </para>
1459        </listitem>
1460       </varlistentry>
1461
1462       <varlistentry>
1463        <term><envar>LDFLAGS_EX</envar></term>
1464        <listitem>
1465         <para>
1466          additional options for linking executables only
1467         </para>
1468        </listitem>
1469       </varlistentry>
1470
1471       <varlistentry>
1472        <term><envar>LDFLAGS_SL</envar></term>
1473        <listitem>
1474         <para>
1475          additional options for linking shared libraries only
1476         </para>
1477        </listitem>
1478       </varlistentry>
1479
1480       <varlistentry>
1481        <term><envar>LLVM_CONFIG</envar></term>
1482        <listitem>
1483         <para>
1484          <command>llvm-config</command> program used to locate the
1485          <productname>LLVM</productname> installation.
1486         </para>
1487        </listitem>
1488       </varlistentry>
1489
1490       <varlistentry>
1491        <term><envar>MSGFMT</envar></term>
1492        <listitem>
1493         <para>
1494          <command>msgfmt</command> program for native language support
1495         </para>
1496        </listitem>
1497       </varlistentry>
1498
1499       <varlistentry>
1500        <term><envar>PERL</envar></term>
1501        <listitem>
1502         <para>
1503          Full path name of the Perl interpreter.  This will be used to
1504          determine the dependencies for building PL/Perl.
1505         </para>
1506        </listitem>
1507       </varlistentry>
1508
1509       <varlistentry>
1510        <term><envar>PYTHON</envar></term>
1511        <listitem>
1512         <para>
1513          Full path name of the Python interpreter.  This will be used to
1514          determine the dependencies for building PL/Python.  Also,
1515          whether Python 2 or 3 is specified here (or otherwise
1516          implicitly chosen) determines which variant of the PL/Python
1517          language becomes available.  See
1518          <xref linkend="plpython-python23"/>
1519          for more information.
1520         </para>
1521        </listitem>
1522       </varlistentry>
1523
1524       <varlistentry>
1525        <term><envar>TCLSH</envar></term>
1526        <listitem>
1527         <para>
1528          Full path name of the Tcl interpreter.  This will be used to
1529          determine the dependencies for building PL/Tcl, and it will
1530          be substituted into Tcl scripts.
1531         </para>
1532        </listitem>
1533       </varlistentry>
1534
1535       <varlistentry>
1536        <term><envar>XML2_CONFIG</envar></term>
1537        <listitem>
1538         <para>
1539          <command>xml2-config</command> program used to locate the
1540          libxml installation.
1541         </para>
1542        </listitem>
1543       </varlistentry>
1544      </variablelist>
1545     </para>
1546
1547     <para>
1548      Sometimes it is useful to add compiler flags after-the-fact to the set
1549      that were chosen by <filename>configure</filename>.  An important example is
1550      that <application>gcc</application>'s <option>-Werror</option> option cannot be included
1551      in the <envar>CFLAGS</envar> passed to <filename>configure</filename>, because
1552      it will break many of <filename>configure</filename>'s built-in tests.  To add
1553      such flags, include them in the <envar>COPT</envar> environment variable
1554      while running <filename>make</filename>.  The contents of <envar>COPT</envar>
1555      are added to both the <envar>CFLAGS</envar> and <envar>LDFLAGS</envar>
1556      options set up by <filename>configure</filename>.  For example, you could do
1557 <screen>
1558 <userinput>make COPT='-Werror'</userinput>
1559 </screen>
1560      or
1561 <screen>
1562 <userinput>export COPT='-Werror'</userinput>
1563 <userinput>make</userinput>
1564 </screen>
1565     </para>
1566
1567     <note>
1568      <para>
1569       When developing code inside the server, it is recommended to
1570       use the configure options <option>--enable-cassert</option> (which
1571       turns on many run-time error checks) and <option>--enable-debug</option>
1572       (which improves the usefulness of debugging tools).
1573      </para>
1574
1575      <para>
1576       If using GCC, it is best to build with an optimization level of
1577       at least <option>-O1</option>, because using no optimization
1578       (<option>-O0</option>) disables some important compiler warnings (such
1579       as the use of uninitialized variables).  However, non-zero
1580       optimization levels can complicate debugging because stepping
1581       through compiled code will usually not match up one-to-one with
1582       source code lines.  If you get confused while trying to debug
1583       optimized code, recompile the specific files of interest with
1584       <option>-O0</option>.  An easy way to do this is by passing an option
1585       to <application>make</application>: <command>make PROFILE=-O0 file.o</command>.
1586      </para>
1587
1588      <para>
1589       The <envar>COPT</envar> and <envar>PROFILE</envar> environment variables are
1590       actually handled identically by the <productname>PostgreSQL</productname>
1591       makefiles.  Which to use is a matter of preference, but a common habit
1592       among developers is to use <envar>PROFILE</envar> for one-time flag
1593       adjustments, while <envar>COPT</envar> might be kept set all the time.
1594      </para>
1595     </note>
1596    </step>
1597
1598   <step id="build">
1599    <title>Build</title>
1600
1601    <para>
1602     To start the build, type either of:
1603 <screen>
1604 <userinput>make</userinput>
1605 <userinput>make all</userinput>
1606 </screen>
1607     (Remember to use <acronym>GNU</acronym> <application>make</application>.)
1608     The build will take a few minutes depending on your
1609     hardware. The last line displayed should be:
1610 <screen>
1611 All of PostgreSQL successfully made. Ready to install.
1612 </screen>
1613    </para>
1614
1615   <para>
1616    If you want to build everything that can be built, including the
1617    documentation (HTML and man pages), and the additional modules
1618    (<filename>contrib</filename>), type instead:
1619 <screen>
1620 <userinput>make world</userinput>
1621 </screen>
1622    The last line displayed should be:
1623 <screen>
1624 PostgreSQL, contrib, and documentation successfully made. Ready to install.
1625 </screen>
1626    </para>
1627
1628    <para>
1629     If you want to invoke the build from another makefile rather than
1630     manually, you must unset <varname>MAKELEVEL</varname> or set it to zero,
1631     for instance like this:
1632 <programlisting>
1633 build-postgresql:
1634         $(MAKE) -C postgresql MAKELEVEL=0 all
1635 </programlisting>
1636     Failure to do that can lead to strange error messages, typically about
1637     missing header files.
1638    </para>
1639   </step>
1640
1641   <step>
1642    <title>Regression Tests</title>
1643
1644    <indexterm>
1645     <primary>regression test</primary>
1646    </indexterm>
1647
1648    <para>
1649     If you want to test the newly built server before you install it,
1650     you can run the regression tests at this point. The regression
1651     tests are a test suite to verify that <productname>PostgreSQL</productname>
1652     runs on your machine in the way the developers expected it
1653     to. Type:
1654 <screen>
1655 <userinput>make check</userinput>
1656 </screen>
1657     (This won't work as root; do it as an unprivileged user.)
1658     See <xref linkend="regress"/> for
1659     detailed information about interpreting the test results. You can
1660     repeat this test at any later time by issuing the same command.
1661    </para>
1662   </step>
1663
1664   <step id="install">
1665    <title>Installing the Files</title>
1666
1667    <note>
1668     <para>
1669      If you are upgrading an existing system be sure to read
1670      <xref linkend="upgrading"/>,
1671      which has instructions about upgrading a
1672      cluster.
1673     </para>
1674    </note>
1675
1676    <para>
1677     To install <productname>PostgreSQL</productname> enter:
1678 <screen>
1679 <userinput>make install</userinput>
1680 </screen>
1681     This will install files into the directories that were specified
1682     in <xref linkend="configure"/>. Make sure that you have appropriate
1683     permissions to write into that area. Normally you need to do this
1684     step as root. Alternatively, you can create the target
1685     directories in advance and arrange for appropriate permissions to
1686     be granted.
1687    </para>
1688
1689    <para>
1690     To install the documentation (HTML and man pages), enter:
1691 <screen>
1692 <userinput>make install-docs</userinput>
1693 </screen>
1694    </para>
1695
1696    <para>
1697     If you built the world above, type instead:
1698 <screen>
1699 <userinput>make install-world</userinput>
1700 </screen>
1701     This also installs the documentation.
1702    </para>
1703
1704    <para>
1705     You can use <literal>make install-strip</literal> instead of
1706     <literal>make install</literal> to strip the executable files and
1707     libraries as they are installed.  This will save some space.  If
1708     you built with debugging support, stripping will effectively
1709     remove the debugging support, so it should only be done if
1710     debugging is no longer needed.  <literal>install-strip</literal>
1711     tries to do a reasonable job saving space, but it does not have
1712     perfect knowledge of how to strip every unneeded byte from an
1713     executable file, so if you want to save all the disk space you
1714     possibly can, you will have to do manual work.
1715    </para>
1716
1717    <para>
1718     The standard installation provides all the header files needed for client
1719     application development as well as for server-side program
1720     development, such as custom functions or data types written in C.
1721     (Prior to <productname>PostgreSQL</productname> 8.0, a separate <literal>make
1722     install-all-headers</literal> command was needed for the latter, but this
1723     step has been folded into the standard install.)
1724    </para>
1725
1726    <formalpara>
1727     <title>Client-only installation:</title>
1728     <para>
1729      If you want to install only the client applications and
1730      interface libraries, then you can use these commands:
1731 <screen>
1732 <userinput>make -C src/bin install</userinput>
1733 <userinput>make -C src/include install</userinput>
1734 <userinput>make -C src/interfaces install</userinput>
1735 <userinput>make -C doc install</userinput>
1736 </screen>
1737     <filename>src/bin</filename> has a few binaries for server-only use,
1738     but they are small.
1739     </para>
1740    </formalpara>
1741   </step>
1742   </procedure>
1743
1744   <formalpara>
1745    <title>Uninstallation:</title>
1746    <para>
1747     To undo the installation use the command <command>make
1748     uninstall</command>. However, this will not remove any created directories.
1749    </para>
1750   </formalpara>
1751
1752   <formalpara>
1753    <title>Cleaning:</title>
1754
1755    <para>
1756     After the installation you can free disk space by removing the built
1757     files from the source tree with the command <command>make
1758     clean</command>. This will preserve the files made by the <command>configure</command>
1759     program, so that you can rebuild everything with <command>make</command>
1760     later on. To reset the source tree to the state in which it was
1761     distributed, use <command>make distclean</command>. If you are going to
1762     build for several platforms within the same source tree you must do
1763     this and re-configure for each platform.  (Alternatively, use
1764     a separate build tree for each platform, so that the source tree
1765     remains unmodified.)
1766    </para>
1767   </formalpara>
1768
1769   <para>
1770    If you perform a build and then discover that your <command>configure</command>
1771    options were wrong, or if you change anything that <command>configure</command>
1772    investigates (for example, software upgrades), then it's a good
1773    idea to do <command>make distclean</command> before reconfiguring and
1774    rebuilding.  Without this, your changes in configuration choices
1775    might not propagate everywhere they need to.
1776   </para>
1777  </sect1>
1778
1779  <sect1 id="install-post">
1780   <title>Post-Installation Setup</title>
1781
1782   <sect2>
1783    <title>Shared Libraries</title>
1784
1785    <indexterm>
1786     <primary>shared library</primary>
1787    </indexterm>
1788
1789    <para>
1790     On some systems with shared libraries
1791     you need to tell the system how to find the newly installed
1792     shared libraries.  The systems on which this is
1793     <emphasis>not</emphasis> necessary include
1794     <systemitem class="osname">FreeBSD</systemitem>,
1795     <systemitem class="osname">HP-UX</systemitem>,
1796     <systemitem class="osname">Linux</systemitem>,
1797     <systemitem class="osname">NetBSD</systemitem>, <systemitem
1798     class="osname">OpenBSD</systemitem>, and
1799     <systemitem class="osname">Solaris</systemitem>.
1800    </para>
1801
1802    <para>
1803     The method to set the shared library search path varies between
1804     platforms, but the most widely-used method is to set the
1805     environment variable <envar>LD_LIBRARY_PATH</envar> like so: In Bourne
1806     shells (<command>sh</command>, <command>ksh</command>, <command>bash</command>, <command>zsh</command>):
1807 <programlisting>
1808 LD_LIBRARY_PATH=/usr/local/pgsql/lib
1809 export LD_LIBRARY_PATH
1810 </programlisting>
1811     or in <command>csh</command> or <command>tcsh</command>:
1812 <programlisting>
1813 setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
1814 </programlisting>
1815     Replace <literal>/usr/local/pgsql/lib</literal> with whatever you set
1816     <option><literal>--libdir</literal></option> to in <xref linkend="configure"/>.
1817     You should put these commands into a shell start-up file such as
1818     <filename>/etc/profile</filename> or <filename>~/.bash_profile</filename>.  Some
1819     good information about the caveats associated with this method can
1820     be found at <ulink
1821     url="http://xahlee.info/UnixResource_dir/_/ldpath.html"></ulink>.
1822    </para>
1823
1824    <para>
1825     On some systems it might be preferable to set the environment
1826     variable <envar>LD_RUN_PATH</envar> <emphasis>before</emphasis>
1827     building.
1828    </para>
1829
1830    <para>
1831     On <systemitem class="osname">Cygwin</systemitem>, put the library
1832     directory in the <envar>PATH</envar> or move the
1833     <filename>.dll</filename> files into the <filename>bin</filename>
1834     directory.
1835    </para>
1836
1837    <para>
1838     If in doubt, refer to the manual pages of your system (perhaps
1839     <command>ld.so</command> or <command>rld</command>). If you later
1840     get a message like:
1841 <screen>
1842 psql: error in loading shared libraries
1843 libpq.so.2.1: cannot open shared object file: No such file or directory
1844 </screen>
1845     then this step was necessary.  Simply take care of it then.
1846    </para>
1847
1848    <para>
1849     <indexterm>
1850      <primary>ldconfig</primary>
1851     </indexterm>
1852     If you are on <systemitem class="osname">Linux</systemitem> and you have root
1853     access, you can run:
1854 <programlisting>
1855 /sbin/ldconfig /usr/local/pgsql/lib
1856 </programlisting>
1857     (or equivalent directory) after installation to enable the
1858     run-time linker to find the shared libraries faster.  Refer to the
1859     manual page of <command>ldconfig</command> for more information.  On
1860     <systemitem class="osname">FreeBSD</systemitem>, <systemitem
1861     class="osname">NetBSD</systemitem>, and <systemitem
1862     class="osname">OpenBSD</systemitem> the command is:
1863 <programlisting>
1864 /sbin/ldconfig -m /usr/local/pgsql/lib
1865 </programlisting>
1866     instead.  Other systems are not known to have an equivalent
1867     command.
1868    </para>
1869   </sect2>
1870
1871   <sect2>
1872    <title>Environment Variables</title>
1873
1874    <indexterm>
1875     <primary><envar>PATH</envar></primary>
1876    </indexterm>
1877
1878    <para>
1879     If you installed into <filename>/usr/local/pgsql</filename> or some other
1880     location that is not searched for programs by default, you should
1881     add <filename>/usr/local/pgsql/bin</filename> (or whatever you set
1882     <option><literal>--bindir</literal></option> to in <xref linkend="configure"/>)
1883     into your <envar>PATH</envar>.  Strictly speaking, this is not
1884     necessary, but it will make the use of <productname>PostgreSQL</productname>
1885     much more convenient.
1886    </para>
1887
1888    <para>
1889     To do this, add the following to your shell start-up file, such as
1890     <filename>~/.bash_profile</filename> (or <filename>/etc/profile</filename>, if you
1891     want it to affect all users):
1892 <programlisting>
1893 PATH=/usr/local/pgsql/bin:$PATH
1894 export PATH
1895 </programlisting>
1896     If you are using <command>csh</command> or <command>tcsh</command>, then use this command:
1897 <programlisting>
1898 set path = ( /usr/local/pgsql/bin $path )
1899 </programlisting>
1900    </para>
1901
1902    <para>
1903     <indexterm>
1904      <primary><envar>MANPATH</envar></primary>
1905     </indexterm>
1906     To enable your system to find the <application>man</application>
1907     documentation, you need to add lines like the following to a
1908     shell start-up file unless you installed into a location that is
1909     searched by default:
1910 <programlisting>
1911 MANPATH=/usr/local/pgsql/share/man:$MANPATH
1912 export MANPATH
1913 </programlisting>
1914    </para>
1915
1916    <para>
1917     The environment variables <envar>PGHOST</envar> and <envar>PGPORT</envar>
1918     specify to client applications the host and port of the database
1919     server, overriding the compiled-in defaults. If you are going to
1920     run client applications remotely then it is convenient if every
1921     user that plans to use the database sets <envar>PGHOST</envar>.  This
1922     is not required, however; the settings can be communicated via command
1923     line options to most client programs.
1924    </para>
1925   </sect2>
1926  </sect1>
1927
1928  <sect1 id="supported-platforms">
1929   <title>Supported Platforms</title>
1930
1931   <para>
1932    A platform (that is, a CPU architecture and operating system combination)
1933    is considered supported by the <productname>PostgreSQL</productname> development
1934    community if the code contains provisions to work on that platform and
1935    it has recently been verified to build and pass its regression tests
1936    on that platform.  Currently, most testing of platform compatibility
1937    is done automatically by test machines in the
1938    <ulink url="https://buildfarm.postgresql.org/">PostgreSQL Build Farm</ulink>.
1939    If you are interested in using <productname>PostgreSQL</productname> on a platform
1940    that is not represented in the build farm, but on which the code works
1941    or can be made to work, you are strongly encouraged to set up a build
1942    farm member machine so that continued compatibility can be assured.
1943   </para>
1944
1945   <para>
1946    In general, <productname>PostgreSQL</productname> can be expected to work on
1947    these CPU architectures: x86, x86_64, IA64, PowerPC,
1948    PowerPC 64, S/390, S/390x, Sparc, Sparc 64, ARM, MIPS, MIPSEL,
1949    and PA-RISC.  Code support exists for M68K, M32R, and VAX, but these
1950    architectures are not known to have been tested recently.  It is often
1951    possible to build on an unsupported CPU type by configuring with
1952    <option>--disable-spinlocks</option>, but performance will be poor.
1953   </para>
1954
1955   <para>
1956    <productname>PostgreSQL</productname> can be expected to work on these operating
1957    systems: Linux (all recent distributions), Windows (Win2000 SP4 and later),
1958    FreeBSD, OpenBSD, NetBSD, macOS, AIX, HP/UX, and Solaris.
1959    Other Unix-like systems may also work but are not currently
1960    being tested.  In most cases, all CPU architectures supported by
1961    a given operating system will work.  Look in
1962    <xref linkend="installation-platform-notes"/> below to see if
1963    there is information
1964    specific to your operating system, particularly if using an older system.
1965   </para>
1966
1967   <para>
1968    If you have installation problems on a platform that is known
1969    to be supported according to recent build farm results, please report
1970    it to <email>pgsql-bugs@postgresql.org</email>.  If you are interested
1971    in porting <productname>PostgreSQL</productname> to a new platform,
1972    <email>pgsql-hackers@postgresql.org</email> is the appropriate place
1973    to discuss that.
1974   </para>
1975  </sect1>
1976
1977  <sect1 id="installation-platform-notes">
1978   <title>Platform-specific Notes</title>
1979
1980   <para>
1981    This section documents additional platform-specific issues
1982    regarding the installation and setup of PostgreSQL.  Be sure to
1983    read the installation instructions, and in
1984    particular <xref linkend="install-requirements"/> as well.  Also,
1985    check <xref linkend="regress"/> regarding the
1986    interpretation of regression test results.
1987   </para>
1988
1989   <para>
1990    Platforms that are not covered here have no known platform-specific
1991    installation issues.
1992   </para>
1993
1994   <sect2 id="installation-notes-aix">
1995    <title>AIX</title>
1996
1997    <indexterm zone="installation-notes-aix">
1998     <primary>AIX</primary>
1999     <secondary>installation on</secondary>
2000    </indexterm>
2001
2002    <para>
2003     PostgreSQL works on AIX, but getting it installed properly can be
2004     challenging.  AIX versions from 4.3.3 to 6.1 are considered supported.
2005     You can use GCC or the native IBM compiler <command>xlc</command>.  In
2006     general, using recent versions of AIX and PostgreSQL helps.  Check
2007     the build farm for up to date information about which versions of
2008     AIX are known to work.
2009    </para>
2010
2011    <para>
2012     The minimum recommended fix levels for supported AIX versions are:
2013    </para>
2014
2015    <variablelist>
2016     <varlistentry>
2017      <term>AIX 4.3.3</term>
2018      <listitem><para>Maintenance Level 11 + post ML11 bundle</para></listitem>
2019     </varlistentry>
2020
2021     <varlistentry>
2022      <term>AIX 5.1</term>
2023      <listitem><para>Maintenance Level 9 + post ML9 bundle</para></listitem>
2024     </varlistentry>
2025
2026     <varlistentry>
2027      <term>AIX 5.2</term>
2028      <listitem><para>Technology Level 10 Service Pack 3</para></listitem>
2029     </varlistentry>
2030
2031     <varlistentry>
2032      <term>AIX 5.3</term>
2033      <listitem><para>Technology Level 7</para></listitem>
2034     </varlistentry>
2035
2036     <varlistentry>
2037      <term>AIX 6.1</term>
2038      <listitem><para>Base Level</para></listitem>
2039     </varlistentry>
2040    </variablelist>
2041
2042    <para>
2043     To check your current fix level, use
2044     <command>oslevel -r</command> in AIX 4.3.3 to AIX 5.2 ML 7, or
2045     <command>oslevel -s</command> in later versions.
2046    </para>
2047
2048    <para>
2049     Use the following <command>configure</command> flags in addition
2050     to your own if you have installed Readline or libz in
2051     <literal>/usr/local</literal>:
2052     <literal>--with-includes=/usr/local/include
2053     --with-libraries=/usr/local/lib</literal>.
2054    </para>
2055
2056    <sect3>
2057     <title>GCC Issues</title>
2058
2059     <para>
2060      On AIX 5.3, there have been some problems getting PostgreSQL to
2061      compile and run using GCC.
2062     </para>
2063
2064     <para>
2065      You will want to use a version of GCC subsequent to 3.3.2,
2066      particularly if you use a prepackaged version.  We had good
2067      success with 4.0.1.  Problems with earlier versions seem to have
2068      more to do with the way IBM packaged GCC than with actual issues
2069      with GCC, so that if you compile GCC yourself, you might well
2070      have success with an earlier version of GCC.
2071     </para>
2072    </sect3>
2073
2074    <sect3>
2075     <title>Unix-Domain Sockets Broken</title>
2076
2077     <para>
2078      AIX 5.3 has a problem
2079      where <structname>sockaddr_storage</structname> is not defined to
2080      be large enough.  In version 5.3, IBM increased the size of
2081      <structname>sockaddr_un</structname>, the address structure for
2082      Unix-domain sockets, but did not correspondingly increase the
2083      size of <structname>sockaddr_storage</structname>.  The result of
2084      this is that attempts to use Unix-domain sockets with PostgreSQL
2085      lead to libpq overflowing the data structure.  TCP/IP connections
2086      work OK, but not Unix-domain sockets, which prevents the
2087      regression tests from working.
2088     </para>
2089
2090     <para>
2091      The problem was reported to IBM, and is recorded as bug report
2092      PMR29657.  If you upgrade to maintenance level 5300-03 or later,
2093      that will include this fix.  A quick workaround
2094      is to alter <symbol>_SS_MAXSIZE</symbol> to 1025 in
2095      <filename>/usr/include/sys/socket.h</filename>.  In either case,
2096      recompile PostgreSQL once you have the corrected header file.
2097     </para>
2098    </sect3>
2099
2100    <sect3>
2101     <title>Internet Address Issues</title>
2102
2103     <para>
2104      PostgreSQL relies on the system's <function>getaddrinfo</function> function
2105      to parse IP addresses in <varname>listen_addresses</varname>,
2106      <filename>pg_hba.conf</filename>, etc.  Older versions of AIX have assorted
2107      bugs in this function.  If you have problems related to these settings,
2108      updating to the appropriate AIX fix level shown above
2109      should take care of it.
2110     </para>
2111
2112     <!-- https://archives.postgresql.org/message-id/6064jt6cfm.fsf_-_@dba2.int.libertyrms.com -->
2113
2114     <para>
2115      One user reports:
2116     </para>
2117
2118     <para>
2119      When implementing PostgreSQL version 8.1 on AIX 5.3, we
2120      periodically ran into problems where the statistics collector
2121      would <quote>mysteriously</quote> not come up successfully.  This
2122      appears to be the result of unexpected behavior in the IPv6
2123      implementation.  It looks like PostgreSQL and IPv6 do not play
2124      very well together on AIX 5.3.
2125     </para>
2126
2127     <para>
2128      Any of the following actions <quote>fix</quote> the problem.
2129      <itemizedlist>
2130       <listitem>
2131        <para>
2132         Delete the IPv6 address for localhost:
2133 <screen>
2134 (as root)
2135 # ifconfig lo0 inet6 ::1/0 delete
2136 </screen>
2137        </para>
2138       </listitem>
2139
2140       <listitem>
2141        <para>
2142         Remove IPv6 from net services.  The
2143         file <filename>/etc/netsvc.conf</filename> on AIX is roughly
2144         equivalent to <filename>/etc/nsswitch.conf</filename> on
2145         Solaris/Linux.  The default, on AIX, is thus:
2146 <programlisting>
2147 hosts=local,bind
2148 </programlisting>
2149         Replace this with:
2150 <programlisting>
2151 hosts=local4,bind4
2152 </programlisting>
2153         to deactivate searching for IPv6 addresses.
2154        </para>
2155       </listitem>
2156      </itemizedlist>
2157     </para>
2158
2159     <warning>
2160     <para>
2161      This is really a workaround for problems relating
2162      to immaturity of IPv6 support, which improved visibly during the
2163      course of AIX 5.3 releases.  It has worked with AIX version 5.3,
2164      but does not represent an elegant solution to the problem.  It has
2165      been reported that this workaround is not only unnecessary, but
2166      causes problems on AIX 6.1, where IPv6 support has become more mature.
2167     </para>
2168     </warning>
2169
2170    </sect3>
2171
2172    <sect3>
2173     <title>Memory Management</title>
2174     <!-- https://archives.postgresql.org/message-id/603bgqmpl9.fsf@dba2.int.libertyrms.com -->
2175
2176     <para>
2177      AIX can be somewhat peculiar with regards to the way it does
2178      memory management.  You can have a server with many multiples of
2179      gigabytes of RAM free, but still get out of memory or address
2180      space errors when running applications.  One example
2181      is loading of extensions failing with unusual errors.
2182      For example, running as the owner of the PostgreSQL installation:
2183 <screen>
2184 =# CREATE EXTENSION plperl;
2185 ERROR:  could not load library "/opt/dbs/pgsql/lib/plperl.so": A memory address is not in the address space for the process.
2186 </screen>
2187     Running as a non-owner in the group possessing the PostgreSQL
2188     installation:
2189 <screen>
2190 =# CREATE EXTENSION plperl;
2191 ERROR:  could not load library "/opt/dbs/pgsql/lib/plperl.so": Bad address
2192 </screen>
2193      Another example is out of memory errors in the PostgreSQL server
2194      logs, with every memory allocation near or greater than 256 MB
2195      failing.
2196     </para>
2197
2198     <para>
2199      The overall cause of all these problems is the default bittedness
2200      and memory model used by the server process.  By default, all
2201      binaries built on AIX are 32-bit.  This does not depend upon
2202      hardware type or kernel in use.  These 32-bit processes are
2203      limited to 4 GB of memory laid out in 256 MB segments using one
2204      of a few models.  The default allows for less than 256 MB in the
2205      heap as it shares a single segment with the stack.
2206     </para>
2207
2208     <para>
2209      In the case of the <literal>plperl</literal> example, above,
2210      check your umask and the permissions of the binaries in your
2211      PostgreSQL installation.  The binaries involved in that example
2212      were 32-bit and installed as mode 750 instead of 755.  Due to the
2213      permissions being set in this fashion, only the owner or a member
2214      of the possessing group can load the library.  Since it isn't
2215      world-readable, the loader places the object into the process'
2216      heap instead of the shared library segments where it would
2217      otherwise be placed.
2218     </para>
2219
2220     <para>
2221      The <quote>ideal</quote> solution for this is to use a 64-bit
2222      build of PostgreSQL, but that is not always practical, because
2223      systems with 32-bit processors can build, but not run, 64-bit
2224      binaries.
2225     </para>
2226
2227     <para>
2228      If a 32-bit binary is desired, set <symbol>LDR_CNTRL</symbol> to
2229      <literal>MAXDATA=0x<replaceable>n</replaceable>0000000</literal>,
2230      where 1 &lt;= n &lt;= 8, before starting the PostgreSQL server,
2231      and try different values and <filename>postgresql.conf</filename>
2232      settings to find a configuration that works satisfactorily.  This
2233      use of <symbol>LDR_CNTRL</symbol> tells AIX that you want the
2234      server to have <symbol>MAXDATA</symbol> bytes set aside for the
2235      heap, allocated in 256 MB segments.  When you find a workable
2236      configuration,
2237      <command>ldedit</command> can be used to modify the binaries so
2238      that they default to using the desired heap size.  PostgreSQL can
2239      also be rebuilt, passing <literal>configure
2240      LDFLAGS="-Wl,-bmaxdata:0x<replaceable>n</replaceable>0000000"</literal>
2241      to achieve the same effect.
2242     </para>
2243
2244     <para>
2245      For a 64-bit build, set <envar>OBJECT_MODE</envar> to 64 and
2246      pass <literal>CC="gcc -maix64"</literal>
2247      and <literal>LDFLAGS="-Wl,-bbigtoc"</literal>
2248      to <command>configure</command>.  (Options for
2249     <command>xlc</command> might differ.)  If you omit the export of
2250     <envar>OBJECT_MODE</envar>, your build may fail with linker errors.  When
2251     <envar>OBJECT_MODE</envar> is set, it tells AIX's build utilities
2252     such as <command>ar</command>, <command>as</command>, and <command>ld</command> what
2253     type of objects to default to handling.
2254     </para>
2255
2256     <para>
2257      By default, overcommit of paging space can happen.  While we have
2258      not seen this occur, AIX will kill processes when it runs out of
2259      memory and the overcommit is accessed.  The closest to this that
2260      we have seen is fork failing because the system decided that
2261      there was not enough memory for another process.  Like many other
2262      parts of AIX, the paging space allocation method and
2263      out-of-memory kill is configurable on a system- or process-wide
2264      basis if this becomes a problem.
2265     </para>
2266
2267     <bibliography>
2268      <title>References and Resources</title>
2269
2270      <biblioentry>
2271       <biblioset relation="article">
2272        <title><ulink url="http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/lrg_prg_support.htm">Large Program Support</ulink></title>
2273       </biblioset>
2274       <biblioset relation="book">
2275        <title>AIX Documentation: General Programming Concepts: Writing and Debugging Programs</title>
2276       </biblioset>
2277      </biblioentry>
2278
2279      <biblioentry>
2280       <biblioset relation="article">
2281        <title><ulink url="http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/address_space.htm">Program Address Space Overview</ulink></title>
2282       </biblioset>
2283       <biblioset relation="book">
2284        <title>AIX Documentation: General Programming Concepts: Writing and Debugging Programs</title>
2285       </biblioset>
2286      </biblioentry>
2287
2288      <biblioentry>
2289       <biblioset relation="article">
2290        <title><ulink url="http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/resmgmt2.htm">Performance Overview of the Virtual Memory Manager (VMM)</ulink></title>
2291       </biblioset>
2292       <biblioset relation="book">
2293        <title>AIX Documentation: Performance Management Guide</title>
2294       </biblioset>
2295      </biblioentry>
2296
2297      <biblioentry>
2298       <biblioset relation="article">
2299        <title><ulink url="http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf7.htm">Page Space Allocation</ulink></title>
2300       </biblioset>
2301       <biblioset relation="book">
2302        <title>AIX Documentation: Performance Management Guide</title>
2303       </biblioset>
2304      </biblioentry>
2305
2306      <biblioentry>
2307       <biblioset relation="article">
2308        <title><ulink url="http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf6.htm">Paging-space thresholds tuning</ulink></title>
2309       </biblioset>
2310       <biblioset relation="book">
2311        <title>AIX Documentation: Performance Management Guide</title>
2312       </biblioset>
2313      </biblioentry>
2314
2315      <biblioentry>
2316        <title><ulink url="http://www.redbooks.ibm.com/abstracts/sg245674.html?Open">Developing and Porting C and C++ Applications on AIX</ulink></title>
2317        <publisher>
2318         <publishername>IBM Redbook</publishername>
2319        </publisher>
2320      </biblioentry>
2321     </bibliography>
2322    </sect3>
2323   </sect2>
2324
2325   <sect2 id="installation-notes-cygwin">
2326    <title>Cygwin</title>
2327
2328    <indexterm zone="installation-notes-cygwin">
2329     <primary>Cygwin</primary>
2330     <secondary>installation on</secondary>
2331    </indexterm>
2332
2333    <para>
2334     PostgreSQL can be built using Cygwin, a Linux-like environment for
2335     Windows, but that method is inferior to the native Windows build
2336     <phrase condition="standalone-ignore">(see <xref linkend="install-windows"/>)</phrase> and
2337     running a server under Cygwin is no longer recommended.
2338    </para>
2339
2340    <para>
2341     When building from source, proceed according to the normal
2342     installation procedure (i.e., <literal>./configure;
2343     make</literal>; etc.), noting the following-Cygwin specific
2344     differences:
2345
2346     <itemizedlist>
2347      <listitem>
2348       <para>
2349        Set your path to use the Cygwin bin directory before the
2350        Windows utilities.  This will help prevent problems with
2351        compilation.
2352       </para>
2353      </listitem>
2354
2355      <listitem>
2356       <para>
2357        The <command>adduser</command> command is not supported; use
2358        the appropriate user management application on Windows NT,
2359        2000, or XP.  Otherwise, skip this step.
2360       </para>
2361      </listitem>
2362
2363      <listitem>
2364       <para>
2365        The <command>su</command> command is not supported; use ssh to
2366        simulate su on Windows NT, 2000, or XP. Otherwise, skip this
2367        step.
2368       </para>
2369      </listitem>
2370
2371      <listitem>
2372       <para>
2373        OpenSSL is not supported.
2374       </para>
2375      </listitem>
2376
2377      <listitem>
2378       <para>
2379        Start <command>cygserver</command> for shared memory support.
2380        To do this, enter the command <literal>/usr/sbin/cygserver
2381        &amp;</literal>.  This program needs to be running anytime you
2382        start the PostgreSQL server or initialize a database cluster
2383        (<command>initdb</command>).  The
2384        default <command>cygserver</command> configuration may need to
2385        be changed (e.g., increase <symbol>SEMMNS</symbol>) to prevent
2386        PostgreSQL from failing due to a lack of system resources.
2387       </para>
2388      </listitem>
2389
2390      <listitem>
2391       <para>
2392         Building might fail on some systems where a locale other than
2393         C is in use. To fix this, set the locale to C by doing
2394         <command>export LANG=C.utf8</command> before building, and then
2395         setting it back to the previous setting, after you have installed
2396         PostgreSQL.
2397       </para>
2398      </listitem>
2399
2400      <listitem>
2401       <para>
2402        The parallel regression tests (<literal>make check</literal>)
2403        can generate spurious regression test failures due to
2404        overflowing the <function>listen()</function> backlog queue
2405        which causes connection refused errors or hangs.  You can limit
2406        the number of connections using the make
2407        variable <varname>MAX_CONNECTIONS</varname> thus:
2408 <programlisting>
2409 make MAX_CONNECTIONS=5 check
2410 </programlisting>
2411        (On some systems you can have up to about 10 simultaneous
2412        connections).
2413       </para>
2414      </listitem>
2415     </itemizedlist>
2416    </para>
2417
2418    <para>
2419     It is possible to install <command>cygserver</command> and the
2420     PostgreSQL server as Windows NT services.  For information on how
2421     to do this, please refer to the <filename>README</filename>
2422     document included with the PostgreSQL binary package on Cygwin.
2423     It is installed in the
2424     directory <filename>/usr/share/doc/Cygwin</filename>.
2425    </para>
2426   </sect2>
2427
2428   <sect2 id="installation-notes-hpux">
2429    <title>HP-UX</title>
2430
2431    <indexterm zone="installation-notes-hpux">
2432     <primary>HP-UX</primary>
2433     <secondary>installation on</secondary>
2434    </indexterm>
2435
2436    <para>
2437     PostgreSQL 7.3+ should work on Series 700/800 PA-RISC machines
2438     running HP-UX 10.X or 11.X, given appropriate system patch levels
2439     and build tools.  At least one developer routinely tests on HP-UX
2440     10.20, and we have reports of successful installations on HP-UX
2441     11.00 and 11.11.
2442    </para>
2443
2444    <para>
2445     Aside from the PostgreSQL source distribution, you will need GNU
2446     make (HP's make will not do), and either GCC or HP's full ANSI C
2447     compiler.  If you intend to build from Git sources rather than a
2448     distribution tarball, you will also need Flex (GNU lex) and Bison
2449     (GNU yacc).  We also recommend making sure you are fairly
2450     up-to-date on HP patches.  At a minimum, if you are building 64
2451     bit binaries on HP-UX 11.11 you may need PHSS_30966 (11.11) or a
2452     successor patch otherwise <command>initdb</command> may hang:
2453 <literallayout>
2454 PHSS_30966  s700_800 ld(1) and linker tools cumulative patch
2455 </literallayout>
2456
2457     On general principles you should be current on libc and ld/dld
2458     patches, as well as compiler patches if you are using HP's C
2459     compiler.  See HP's support sites such
2460     as <ulink url="ftp://us-ffs.external.hp.com/"></ulink> for free
2461     copies of their latest patches.
2462    </para>
2463
2464    <para>
2465     If you are building on a PA-RISC 2.0 machine and want to have
2466     64-bit binaries using GCC, you must use a GCC 64-bit version.
2467    </para>
2468
2469    <para>
2470     If you are building on a PA-RISC 2.0 machine and want the compiled
2471     binaries to run on PA-RISC 1.1 machines you will need to specify
2472     <option>+DAportable</option> in <envar>CFLAGS</envar>.
2473    </para>
2474
2475    <para>
2476     If you are building on a HP-UX Itanium machine, you will need the
2477     latest HP ANSI C compiler with its dependent patch or successor
2478     patches:
2479 <literallayout>
2480 PHSS_30848  s700_800 HP C Compiler (A.05.57)
2481 PHSS_30849  s700_800 u2comp/be/plugin library Patch
2482 </literallayout>
2483    </para>
2484
2485    <para>
2486     If you have both HP's C compiler and GCC's, then you might want to
2487     explicitly select the compiler to use when you
2488     run <command>configure</command>:
2489 <programlisting>
2490 ./configure CC=cc
2491 </programlisting>
2492     for HP's C compiler, or
2493 <programlisting>
2494 ./configure CC=gcc
2495 </programlisting>
2496     for GCC.  If you omit this setting, then configure will
2497     pick <command>gcc</command> if it has a choice.
2498    </para>
2499
2500    <para>
2501     The default install target location
2502     is <filename>/usr/local/pgsql</filename>, which you might want to
2503     change to something under <filename>/opt</filename>.  If so, use
2504     the
2505     <option>--prefix</option> switch to <command>configure</command>.
2506    </para>
2507
2508    <para>
2509     In the regression tests, there might be some low-order-digit
2510     differences in the geometry tests, which vary depending on which
2511     compiler and math library versions you use.  Any other error is
2512     cause for suspicion.
2513    </para>
2514   </sect2>
2515
2516   <sect2 id="installation-notes-macos">
2517    <title>macOS</title>
2518
2519    <indexterm zone="installation-notes-macos">
2520     <primary>macOS</primary>
2521     <secondary>installation on</secondary>
2522    </indexterm>
2523
2524    <para>
2525     On recent <productname>macOS</productname> releases, it's necessary to
2526     embed the <quote>sysroot</quote> path in the include switches used to
2527     find some system header files.  This results in the outputs of
2528     the <application>configure</application> script varying depending on
2529     which SDK version was used during <application>configure</application>.
2530     That shouldn't pose any problem in simple scenarios, but if you are
2531     trying to do something like building an extension on a different machine
2532     than the server code was built on, you may need to force use of a
2533     different sysroot path.  To do that, set <varname>PG_SYSROOT</varname>,
2534     for example
2535 <programlisting>
2536 make PG_SYSROOT=<replaceable>/desired/path</replaceable> all
2537 </programlisting>
2538     To find out the appropriate path on your machine, run
2539 <programlisting>
2540 xcodebuild -version -sdk macosx Path
2541 </programlisting>
2542     Note that building an extension using a different sysroot version than
2543     was used to build the core server is not really recommended; in the
2544     worst case it could result in hard-to-debug ABI inconsistencies.
2545    </para>
2546
2547    <para>
2548     You can also select a non-default sysroot path when configuring, by
2549     specifying <varname>PG_SYSROOT</varname>
2550     to <application>configure</application>:
2551 <programlisting>
2552 ./configure ... PG_SYSROOT=<replaceable>/desired/path</replaceable>
2553 </programlisting>
2554    </para>
2555
2556    <para>
2557     <productname>macOS</productname>'s <quote>System Integrity
2558     Protection</quote> (SIP) feature breaks <literal>make check</literal>,
2559     because it prevents passing the needed setting
2560     of <literal>DYLD_LIBRARY_PATH</literal> down to the executables being
2561     tested.  You can work around that by doing <literal>make
2562     install</literal> before <literal>make check</literal>.
2563     Most Postgres developers just turn off SIP, though.
2564    </para>
2565   </sect2>
2566
2567   <sect2 id="installation-notes-mingw">
2568    <title>MinGW/Native Windows</title>
2569
2570    <indexterm zone="installation-notes-mingw">
2571     <primary>MinGW</primary>
2572     <secondary>installation on</secondary>
2573    </indexterm>
2574
2575    <para>
2576     PostgreSQL for Windows can be built using MinGW, a Unix-like build
2577     environment for Microsoft operating systems, or using
2578     Microsoft's <productname>Visual C++</productname> compiler suite.
2579     The MinGW build variant uses the normal build system described in
2580     this chapter; the Visual C++ build works completely differently
2581     and is described in <xref linkend="install-windows"/>.
2582     It is a fully native build and uses no additional software like
2583     MinGW.  A ready-made installer is available on the main
2584     PostgreSQL web site.
2585    </para>
2586
2587    <para>
2588     The native Windows port requires a 32 or 64-bit version of Windows
2589     2000 or later. Earlier operating systems do
2590     not have sufficient infrastructure (but Cygwin may be used on
2591     those).  MinGW, the Unix-like build tools, and MSYS, a collection
2592     of Unix tools required to run shell scripts
2593     like <command>configure</command>, can be downloaded
2594     from <ulink url="http://www.mingw.org/"></ulink>.  Neither is
2595     required to run the resulting binaries; they are needed only for
2596     creating the binaries.
2597    </para>
2598
2599    <para>
2600      To build 64 bit binaries using MinGW, install the 64 bit tool set
2601      from <ulink url="https://mingw-w64.org/"></ulink>, put its bin
2602      directory in the <envar>PATH</envar>, and run
2603      <command>configure</command> with the
2604      <command>--host=x86_64-w64-mingw32</command> option.
2605    </para>
2606
2607    <para>
2608     After you have everything installed, it is suggested that you
2609     run <application>psql</application>
2610     under <command>CMD.EXE</command>, as the MSYS console has
2611     buffering issues.
2612    </para>
2613
2614    <sect3 id="windows-crash-dumps">
2615     <title>Collecting Crash Dumps on Windows</title>
2616
2617     <para>
2618      If PostgreSQL on Windows crashes, it has the ability to generate
2619      <productname>minidumps</productname> that can be used to track down the cause
2620      for the crash, similar to core dumps on Unix. These dumps can be
2621      read using the <productname>Windows Debugger Tools</productname> or using
2622      <productname>Visual Studio</productname>. To enable the generation of dumps
2623      on Windows, create a subdirectory named <filename>crashdumps</filename>
2624      inside the cluster data directory. The dumps will then be written
2625      into this directory with a unique name based on the identifier of
2626      the crashing process and the current time of the crash.
2627     </para>
2628    </sect3>
2629   </sect2>
2630
2631   <sect2 id="installation-notes-solaris">
2632    <title>Solaris</title>
2633
2634    <indexterm zone="installation-notes-solaris">
2635     <primary>Solaris</primary>
2636     <secondary>installation on</secondary>
2637    </indexterm>
2638
2639    <para>
2640     PostgreSQL is well-supported on Solaris.  The more up to date your
2641     operating system, the fewer issues you will experience; details
2642     below.
2643    </para>
2644
2645    <sect3>
2646     <title>Required Tools</title>
2647
2648     <para>
2649      You can build with either GCC or Sun's compiler suite.  For
2650      better code optimization, Sun's compiler is strongly recommended
2651      on the SPARC architecture.  We have heard reports of problems
2652      when using GCC 2.95.1; GCC 2.95.3 or later is recommended.  If
2653      you are using Sun's compiler, be careful not to select
2654      <filename>/usr/ucb/cc</filename>;
2655      use <filename>/opt/SUNWspro/bin/cc</filename>.
2656     </para>
2657
2658     <para>
2659      You can download Sun Studio
2660      from <ulink url="https://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/"></ulink>.
2661      Many of GNU tools are integrated into Solaris 10, or they are
2662      present on the Solaris companion CD.  If you like packages for
2663      older version of Solaris, you can find these tools
2664      at <ulink url="http://www.sunfreeware.com"></ulink>.
2665      If you prefer
2666      sources, look
2667      at <ulink url="https://www.gnu.org/prep/ftp"></ulink>.
2668     </para>
2669    </sect3>
2670
2671    <sect3>
2672     <title>configure Complains About a Failed Test Program</title>
2673
2674     <para>
2675      If <command>configure</command> complains about a failed test
2676      program, this is probably a case of the run-time linker being
2677      unable to find some library, probably libz, libreadline or some
2678      other non-standard library such as libssl.  To point it to the
2679      right location, set the <envar>LDFLAGS</envar> environment
2680      variable on the <command>configure</command> command line, e.g.,
2681 <programlisting>
2682 configure ... LDFLAGS="-R /usr/sfw/lib:/opt/sfw/lib:/usr/local/lib"
2683 </programlisting>
2684      See
2685      the <citerefentry><refentrytitle>ld</refentrytitle><manvolnum>1</manvolnum></citerefentry>
2686      man page for more information.
2687     </para>
2688    </sect3>
2689
2690    <sect3>
2691     <title>Compiling for Optimal Performance</title>
2692
2693     <para>
2694      On the SPARC architecture, Sun Studio is strongly recommended for
2695      compilation.  Try using the <option>-xO5</option> optimization
2696      flag to generate significantly faster binaries.  Do not use any
2697      flags that modify behavior of floating-point operations
2698      and <varname>errno</varname> processing (e.g.,
2699      <option>-fast</option>).  These flags could raise some
2700      nonstandard PostgreSQL behavior for example in the date/time
2701      computing.
2702     </para>
2703
2704     <para>
2705      If you do not have a reason to use 64-bit binaries on SPARC,
2706      prefer the 32-bit version.  The 64-bit operations are slower and
2707      64-bit binaries are slower than the 32-bit variants.  And on
2708      other hand, 32-bit code on the AMD64 CPU family is not native,
2709      and that is why 32-bit code is significant slower on this CPU
2710      family.
2711     </para>
2712    </sect3>
2713
2714    <sect3>
2715     <title>Using DTrace for Tracing PostgreSQL</title>
2716
2717     <para>
2718      Yes, using DTrace is possible.  See <xref linkend="dynamic-trace"/> for
2719      further information.
2720     </para>
2721
2722     <para>
2723      If you see the linking of the <command>postgres</command> executable abort with an
2724      error message like:
2725 <screen>
2726 Undefined                       first referenced
2727  symbol                             in file
2728 AbortTransaction                    utils/probes.o
2729 CommitTransaction                   utils/probes.o
2730 ld: fatal: Symbol referencing errors. No output written to postgres
2731 collect2: ld returned 1 exit status
2732 make: *** [postgres] Error 1
2733 </screen>
2734      your DTrace installation is too old to handle probes in static
2735      functions.  You need Solaris 10u4 or newer.
2736     </para>
2737    </sect3>
2738   </sect2>
2739  </sect1>
2740
2741 </chapter>