1 <!-- doc/src/sgml/installation.sgml -->
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.
11 <chapter id="installation">
12 <title>Installation from Source Code</title>
14 <indexterm zone="installation">
15 <primary>installation</primary>
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.)
26 <sect1 id="install-short">
27 <title>Short Version</title>
36 mkdir /usr/local/pgsql/data
37 chown postgres /usr/local/pgsql/data
39 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
40 /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
41 /usr/local/pgsql/bin/createdb test
42 /usr/local/pgsql/bin/psql test
44 The long version is the rest of this
45 <phrase>chapter</phrase>.
50 <sect1 id="install-requirements">
51 <title>Requirements</title>
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.
64 The following software packages are required for building
65 <productname>PostgreSQL</productname>:
71 <primary>make</primary>
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:
80 <userinput>make --version</userinput>
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.
97 <application>tar</application> is required to unpack the source
98 distribution, in addition to either
99 <application>gzip</application> or <application>bzip2</application>.
106 <primary>readline</primary>
109 <primary>libedit</primary>
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.
136 <primary>zlib</primary>
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>.
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:
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
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).
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"/>
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.
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.
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
247 You need <productname>OpenSSL</productname>, if you want to support
248 encrypted client connections. The minimum required version is
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.
263 To build the <productname>PostgreSQL</productname> documentation,
264 there is a separate set of requirements; see
265 <xref linkend="docguide-toolsets"/>.
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:
280 <primary>flex</primary>
283 <primary>lex</primary>
286 <primary>bison</primary>
289 <primary>yacc</primary>
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.
303 <primary>perl</primary>
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.
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>.
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
336 <sect1 id="install-getsource">
337 <title>Getting The Source</title>
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:
347 <userinput>gunzip postgresql-&version;.tar.gz</userinput>
348 <userinput>tar xf postgresql-&version;.tar</userinput>
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.
360 You can also get the source directly from the version control repository, see
361 <xref linkend="sourcerepo"/>.
365 <sect1 id="install-procedure">
366 <title>Installation Procedure</title>
370 <step id="configure">
371 <title>Configuration</title>
373 <indexterm zone="configure">
374 <primary>configure</primary>
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:
383 <userinput>./configure</userinput>
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>
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>
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.
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>:
416 <term><option>--prefix=<replaceable>PREFIX</replaceable></option></term>
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.
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.)
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.
445 <term><option>--exec-prefix=<replaceable>EXEC-PREFIX</replaceable></option></term>
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.
461 <term><option>--bindir=<replaceable>DIRECTORY</replaceable></option></term>
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>.
472 <term><option>--sysconfdir=<replaceable>DIRECTORY</replaceable></option></term>
475 Sets the directory for various configuration files,
476 <filename><replaceable>PREFIX</replaceable>/etc</filename> by default.
482 <term><option>--libdir=<replaceable>DIRECTORY</replaceable></option></term>
485 Sets the location to install libraries and dynamically loadable
486 modules. The default is
487 <filename><replaceable>EXEC-PREFIX</replaceable>/lib</filename>.
493 <term><option>--includedir=<replaceable>DIRECTORY</replaceable></option></term>
496 Sets the directory for installing C and C++ header files. The
497 default is <filename><replaceable>PREFIX</replaceable>/include</filename>.
503 <term><option>--datarootdir=<replaceable>DIRECTORY</replaceable></option></term>
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>.
515 <term><option>--datadir=<replaceable>DIRECTORY</replaceable></option></term>
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.
527 <term><option>--localedir=<replaceable>DIRECTORY</replaceable></option></term>
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>.
538 <term><option>--mandir=<replaceable>DIRECTORY</replaceable></option></term>
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>.
550 <term><option>--docdir=<replaceable>DIRECTORY</replaceable></option></term>
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>.
562 <term><option>--htmldir=<replaceable>DIRECTORY</replaceable></option></term>
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>.
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.
605 <term><option>--with-extra-version=<replaceable>STRING</replaceable></option></term>
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.
618 <term><option>--with-includes=<replaceable>DIRECTORIES</replaceable></option></term>
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
626 you have to use this option and probably also the corresponding
627 <option>--with-libraries</option> option.
630 Example: <literal>--with-includes=/opt/gnu/include:/usr/sup/include</literal>.
636 <term><option>--with-libraries=<replaceable>DIRECTORIES</replaceable></option></term>
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.
646 Example: <literal>--with-libraries=/opt/gnu/lib:/usr/sup/lib</literal>.
652 <term><option>--enable-nls<optional>=<replaceable>LANGUAGES</replaceable></optional></option></term>
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
668 To use this option, you will need an implementation of the
669 <application>Gettext</application> API; see above.
675 <term><option>--with-pgport=<replaceable>NUMBER</replaceable></option></term>
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.
690 <term><option>--with-perl</option></term>
693 Build the <application>PL/Perl</application> server-side language.
699 <term><option>--with-python</option></term>
702 Build the <application>PL/Python</application> server-side language.
708 <term><option>--with-tcl</option></term>
711 Build the <application>PL/Tcl</application> server-side language.
717 <term><option>--with-tclconfig=<replaceable>DIRECTORY</replaceable></option></term>
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
731 <term><option>--with-gssapi</option></term>
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.
748 <term><option>--with-krb-srvnam=<replaceable>NAME</replaceable></option></term>
751 The default name of the Kerberos service principal used
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>.
761 <varlistentry id="configure-with-llvm">
762 <term><option>--with-llvm</option></term>
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
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
782 ./configure ... --with-llvm LLVM_CONFIG='/path/to/llvm/bin/llvm-config'
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).
797 <term><option>--with-icu</option></term>
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.
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:
817 ./configure ... --with-icu ICU_CFLAGS='-I/some/where/include' ICU_LIBS='-L/some/where/lib -licui18n -licuuc -licudata'
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>.)
828 <term><option>--with-openssl</option>
830 <primary>OpenSSL</primary>
831 <seealso>SSL</seealso>
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
847 <term><option>--with-pam</option></term>
850 Build with <acronym>PAM</acronym><indexterm><primary>PAM</primary></indexterm>
851 (Pluggable Authentication Modules) support.
857 <term><option>--with-bsd-auth</option></term>
860 Build with BSD Authentication support.
861 (The BSD Authentication framework is
862 currently only available on OpenBSD.)
868 <term><option>--with-ldap</option></term>
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
886 <term><option>--with-systemd</option></term>
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
902 <term><option>--without-readline</option></term>
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.
914 <term><option>--with-libedit-preferred</option></term>
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>.
926 <term><option>--with-bonjour</option></term>
929 Build with Bonjour support. This requires Bonjour support
930 in your operating system. Recommended on macOS.
936 <term><option>--with-uuid=<replaceable>LIBRARY</replaceable></option></term>
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:
947 <option>bsd</option> to use the UUID functions found in FreeBSD, NetBSD,
948 and some other BSD-derived systems
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
961 <option>ossp</option> to use the <ulink
962 url="http://www.ossp.org/pkg/lib/uuid/">OSSP UUID library</ulink>
970 <term><option>--with-ossp-uuid</option></term>
973 Obsolete equivalent of <literal>--with-uuid=ossp</literal>.
979 <term><option>--with-libxml</option></term>
982 Build with libxml (enables SQL/XML support). Libxml version 2.6.23 or
983 later is required for this feature.
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>.
1002 <term><option>--with-libxslt</option></term>
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.
1014 <term><option>--disable-float4-byval</option></term>
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.
1029 <term><option>--disable-float8-byval</option></term>
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>.
1048 <term><option>--with-segsize=<replaceable>SEGSIZE</replaceable></option></term>
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
1065 Note that changing this value requires an initdb.
1071 <term><option>--with-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
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
1078 The value must be a power of 2 between 1 and 32 (kilobytes).
1079 Note that changing this value requires an initdb.
1085 <term><option>--with-wal-blocksize=<replaceable>BLOCKSIZE</replaceable></option></term>
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
1092 The value must be a power of 2 between 1 and 64 (kilobytes).
1093 Note that changing this value requires an initdb.
1099 <term><option>--disable-spinlocks</option></term>
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.
1115 <term><option>--disable-strong-random</option></term>
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.
1133 <term><option>--disable-thread-safety</option></term>
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.
1145 <term><option>--with-system-tzdata=<replaceable>DIRECTORY</replaceable></option>
1147 <primary>time zone data</primary>
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>.
1169 <indexterm><primary>cross compilation</primary></indexterm>
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
1185 <term><option>--without-zlib</option></term>
1189 <primary>zlib</primary>
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.
1201 <term><option>--enable-debug</option></term>
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.
1219 <term><option>--enable-coverage</option></term>
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
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.
1234 <term><option>--enable-profiling</option></term>
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.
1246 <term><option>--enable-cassert</option></term>
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
1265 <term><option>--enable-depend</option></term>
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.
1279 <term><option>--enable-dtrace</option></term>
1283 <primary>DTrace</primary>
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>
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.
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:
1307 ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
1309 Using Sun's compiler:
1311 ./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
1318 <term><option>--enable-tap-tests</option></term>
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>
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.
1341 You can specify environment variables on the
1342 <filename>configure</filename> command line, for example:
1344 <userinput>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</userinput>
1349 Here is a list of the significant variables that can be set in
1354 <term><envar>BISON</envar></term>
1363 <term><envar>CC</envar></term>
1372 <term><envar>CFLAGS</envar></term>
1375 options to pass to the C compiler
1381 <term><envar>CLANG</envar></term>
1384 path to <command>clang</command> program used to process source code
1385 for inlining when compiling with <literal>--with-llvm</literal>
1391 <term><envar>CPP</envar></term>
1400 <term><envar>CPPFLAGS</envar></term>
1403 options to pass to the C preprocessor
1409 <term><envar>CXX</envar></term>
1418 <term><envar>CXXFLAGS</envar></term>
1421 options to pass to the C++ compiler
1427 <term><envar>DTRACE</envar></term>
1430 location of the <command>dtrace</command> program
1436 <term><envar>DTRACEFLAGS</envar></term>
1439 options to pass to the <command>dtrace</command> program
1445 <term><envar>FLEX</envar></term>
1454 <term><envar>LDFLAGS</envar></term>
1457 options to use when linking either executables or shared libraries
1463 <term><envar>LDFLAGS_EX</envar></term>
1466 additional options for linking executables only
1472 <term><envar>LDFLAGS_SL</envar></term>
1475 additional options for linking shared libraries only
1481 <term><envar>LLVM_CONFIG</envar></term>
1484 <command>llvm-config</command> program used to locate the
1485 <productname>LLVM</productname> installation.
1491 <term><envar>MSGFMT</envar></term>
1494 <command>msgfmt</command> program for native language support
1500 <term><envar>PERL</envar></term>
1503 Full path name of the Perl interpreter. This will be used to
1504 determine the dependencies for building PL/Perl.
1510 <term><envar>PYTHON</envar></term>
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.
1525 <term><envar>TCLSH</envar></term>
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.
1536 <term><envar>XML2_CONFIG</envar></term>
1539 <command>xml2-config</command> program used to locate the
1540 libxml installation.
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
1558 <userinput>make COPT='-Werror'</userinput>
1562 <userinput>export COPT='-Werror'</userinput>
1563 <userinput>make</userinput>
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).
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>.
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.
1599 <title>Build</title>
1602 To start the build, type either of:
1604 <userinput>make</userinput>
1605 <userinput>make all</userinput>
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:
1611 All of PostgreSQL successfully made. Ready to install.
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:
1620 <userinput>make world</userinput>
1622 The last line displayed should be:
1624 PostgreSQL, contrib, and documentation successfully made. Ready to install.
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:
1634 $(MAKE) -C postgresql MAKELEVEL=0 all
1636 Failure to do that can lead to strange error messages, typically about
1637 missing header files.
1642 <title>Regression Tests</title>
1645 <primary>regression test</primary>
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
1655 <userinput>make check</userinput>
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.
1665 <title>Installing the Files</title>
1669 If you are upgrading an existing system be sure to read
1670 <xref linkend="upgrading"/>,
1671 which has instructions about upgrading a
1677 To install <productname>PostgreSQL</productname> enter:
1679 <userinput>make install</userinput>
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
1690 To install the documentation (HTML and man pages), enter:
1692 <userinput>make install-docs</userinput>
1697 If you built the world above, type instead:
1699 <userinput>make install-world</userinput>
1701 This also installs the documentation.
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.
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.)
1727 <title>Client-only installation:</title>
1729 If you want to install only the client applications and
1730 interface libraries, then you can use these commands:
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>
1737 <filename>src/bin</filename> has a few binaries for server-only use,
1745 <title>Uninstallation:</title>
1747 To undo the installation use the command <command>make
1748 uninstall</command>. However, this will not remove any created directories.
1753 <title>Cleaning:</title>
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.)
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.
1779 <sect1 id="install-post">
1780 <title>Post-Installation Setup</title>
1783 <title>Shared Libraries</title>
1786 <primary>shared library</primary>
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>.
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>):
1808 LD_LIBRARY_PATH=/usr/local/pgsql/lib
1809 export LD_LIBRARY_PATH
1811 or in <command>csh</command> or <command>tcsh</command>:
1813 setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
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
1821 url="http://xahlee.info/UnixResource_dir/_/ldpath.html"></ulink>.
1825 On some systems it might be preferable to set the environment
1826 variable <envar>LD_RUN_PATH</envar> <emphasis>before</emphasis>
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>
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
1842 psql: error in loading shared libraries
1843 libpq.so.2.1: cannot open shared object file: No such file or directory
1845 then this step was necessary. Simply take care of it then.
1850 <primary>ldconfig</primary>
1852 If you are on <systemitem class="osname">Linux</systemitem> and you have root
1853 access, you can run:
1855 /sbin/ldconfig /usr/local/pgsql/lib
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:
1864 /sbin/ldconfig -m /usr/local/pgsql/lib
1866 instead. Other systems are not known to have an equivalent
1872 <title>Environment Variables</title>
1875 <primary><envar>PATH</envar></primary>
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.
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):
1893 PATH=/usr/local/pgsql/bin:$PATH
1896 If you are using <command>csh</command> or <command>tcsh</command>, then use this command:
1898 set path = ( /usr/local/pgsql/bin $path )
1904 <primary><envar>MANPATH</envar></primary>
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:
1911 MANPATH=/usr/local/pgsql/share/man:$MANPATH
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.
1928 <sect1 id="supported-platforms">
1929 <title>Supported Platforms</title>
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.
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.
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.
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
1977 <sect1 id="installation-platform-notes">
1978 <title>Platform-specific Notes</title>
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.
1990 Platforms that are not covered here have no known platform-specific
1991 installation issues.
1994 <sect2 id="installation-notes-aix">
1997 <indexterm zone="installation-notes-aix">
1998 <primary>AIX</primary>
1999 <secondary>installation on</secondary>
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.
2012 The minimum recommended fix levels for supported AIX versions are:
2017 <term>AIX 4.3.3</term>
2018 <listitem><para>Maintenance Level 11 + post ML11 bundle</para></listitem>
2022 <term>AIX 5.1</term>
2023 <listitem><para>Maintenance Level 9 + post ML9 bundle</para></listitem>
2027 <term>AIX 5.2</term>
2028 <listitem><para>Technology Level 10 Service Pack 3</para></listitem>
2032 <term>AIX 5.3</term>
2033 <listitem><para>Technology Level 7</para></listitem>
2037 <term>AIX 6.1</term>
2038 <listitem><para>Base Level</para></listitem>
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.
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>.
2057 <title>GCC Issues</title>
2060 On AIX 5.3, there have been some problems getting PostgreSQL to
2061 compile and run using GCC.
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.
2075 <title>Unix-Domain Sockets Broken</title>
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.
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.
2101 <title>Internet Address Issues</title>
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.
2112 <!-- https://archives.postgresql.org/message-id/6064jt6cfm.fsf_-_@dba2.int.libertyrms.com -->
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.
2128 Any of the following actions <quote>fix</quote> the problem.
2132 Delete the IPv6 address for localhost:
2135 # ifconfig lo0 inet6 ::1/0 delete
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:
2153 to deactivate searching for IPv6 addresses.
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.
2173 <title>Memory Management</title>
2174 <!-- https://archives.postgresql.org/message-id/603bgqmpl9.fsf@dba2.int.libertyrms.com -->
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:
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.
2187 Running as a non-owner in the group possessing the PostgreSQL
2190 =# CREATE EXTENSION plperl;
2191 ERROR: could not load library "/opt/dbs/pgsql/lib/plperl.so": Bad address
2193 Another example is out of memory errors in the PostgreSQL server
2194 logs, with every memory allocation near or greater than 256 MB
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.
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.
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
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 <= n <= 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
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.
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.
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.
2268 <title>References and Resources</title>
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>
2274 <biblioset relation="book">
2275 <title>AIX Documentation: General Programming Concepts: Writing and Debugging Programs</title>
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>
2283 <biblioset relation="book">
2284 <title>AIX Documentation: General Programming Concepts: Writing and Debugging Programs</title>
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>
2292 <biblioset relation="book">
2293 <title>AIX Documentation: Performance Management Guide</title>
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>
2301 <biblioset relation="book">
2302 <title>AIX Documentation: Performance Management Guide</title>
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>
2310 <biblioset relation="book">
2311 <title>AIX Documentation: Performance Management Guide</title>
2316 <title><ulink url="http://www.redbooks.ibm.com/abstracts/sg245674.html?Open">Developing and Porting C and C++ Applications on AIX</ulink></title>
2318 <publishername>IBM Redbook</publishername>
2325 <sect2 id="installation-notes-cygwin">
2326 <title>Cygwin</title>
2328 <indexterm zone="installation-notes-cygwin">
2329 <primary>Cygwin</primary>
2330 <secondary>installation on</secondary>
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.
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
2349 Set your path to use the Cygwin bin directory before the
2350 Windows utilities. This will help prevent problems with
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.
2365 The <command>su</command> command is not supported; use ssh to
2366 simulate su on Windows NT, 2000, or XP. Otherwise, skip this
2373 OpenSSL is not supported.
2379 Start <command>cygserver</command> for shared memory support.
2380 To do this, enter the command <literal>/usr/sbin/cygserver
2381 &</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.
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
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:
2409 make MAX_CONNECTIONS=5 check
2411 (On some systems you can have up to about 10 simultaneous
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>.
2428 <sect2 id="installation-notes-hpux">
2429 <title>HP-UX</title>
2431 <indexterm zone="installation-notes-hpux">
2432 <primary>HP-UX</primary>
2433 <secondary>installation on</secondary>
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
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:
2454 PHSS_30966 s700_800 ld(1) and linker tools cumulative patch
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.
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.
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>.
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
2480 PHSS_30848 s700_800 HP C Compiler (A.05.57)
2481 PHSS_30849 s700_800 u2comp/be/plugin library Patch
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>:
2492 for HP's C compiler, or
2496 for GCC. If you omit this setting, then configure will
2497 pick <command>gcc</command> if it has a choice.
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
2505 <option>--prefix</option> switch to <command>configure</command>.
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.
2516 <sect2 id="installation-notes-macos">
2517 <title>macOS</title>
2519 <indexterm zone="installation-notes-macos">
2520 <primary>macOS</primary>
2521 <secondary>installation on</secondary>
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>,
2536 make PG_SYSROOT=<replaceable>/desired/path</replaceable> all
2538 To find out the appropriate path on your machine, run
2540 xcodebuild -version -sdk macosx Path
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.
2548 You can also select a non-default sysroot path when configuring, by
2549 specifying <varname>PG_SYSROOT</varname>
2550 to <application>configure</application>:
2552 ./configure ... PG_SYSROOT=<replaceable>/desired/path</replaceable>
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.
2567 <sect2 id="installation-notes-mingw">
2568 <title>MinGW/Native Windows</title>
2570 <indexterm zone="installation-notes-mingw">
2571 <primary>MinGW</primary>
2572 <secondary>installation on</secondary>
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.
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.
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.
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
2614 <sect3 id="windows-crash-dumps">
2615 <title>Collecting Crash Dumps on Windows</title>
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.
2631 <sect2 id="installation-notes-solaris">
2632 <title>Solaris</title>
2634 <indexterm zone="installation-notes-solaris">
2635 <primary>Solaris</primary>
2636 <secondary>installation on</secondary>
2640 PostgreSQL is well-supported on Solaris. The more up to date your
2641 operating system, the fewer issues you will experience; details
2646 <title>Required Tools</title>
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>.
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>.
2667 at <ulink url="https://www.gnu.org/prep/ftp"></ulink>.
2672 <title>configure Complains About a Failed Test Program</title>
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.,
2682 configure ... LDFLAGS="-R /usr/sfw/lib:/opt/sfw/lib:/usr/local/lib"
2685 the <citerefentry><refentrytitle>ld</refentrytitle><manvolnum>1</manvolnum></citerefentry>
2686 man page for more information.
2691 <title>Compiling for Optimal Performance</title>
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
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
2715 <title>Using DTrace for Tracing PostgreSQL</title>
2718 Yes, using DTrace is possible. See <xref linkend="dynamic-trace"/> for
2719 further information.
2723 If you see the linking of the <command>postgres</command> executable abort with an
2726 Undefined first referenced
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
2734 your DTrace installation is too old to handle probes in static
2735 functions. You need Solaris 10u4 or newer.