1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>14.5.Installation Procedure</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="installation.html" title="Chapter14. Installation Instructions">
<link rel="prev" href="install-upgrading.html" title="14.4.If You Are Upgrading">
<link rel="next" href="install-post.html" title="14.6.Post-Installation Setup">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="install-procedure"></a>14.5.Installation Procedure</h2></div></div></div>
<div class="procedure"><ol type="1">
<li>
<a name="configure"></a><p class="title"><b>Configuration</b></p>
<a name="id635634"></a><p> The first step of the installation procedure is to configure the
source tree for your system and choose the options you would like.
This is done by running the <code class="filename">configure</code> script. For a
default installation simply enter
</p>
<pre class="screen"><strong class="userinput"><code>./configure</code></strong></pre>
<p>
This script will run a number of tests to guess values for various
system dependent variables and detect some quirks of your
operating system, and finally will create several files in the
build tree to record what it found. (You can also run
<code class="filename">configure</code> in a directory outside the source
tree if you want to keep the build directory separate.)
</p>
<p> The default configuration will build the server and utilities, as
well as all client applications and interfaces that require only a
C compiler. All files will be installed under
<code class="filename">/usr/local/pgsql</code> by default.
</p>
<p> You can customize the build and installation process by supplying one
or more of the following command line options to
<code class="filename">configure</code>:
</p>
<div class="variablelist"><dl>
<dt><span class="term"><code class="option">--prefix=<em class="replaceable"><code>PREFIX</code></em></code></span></dt>
<dd>
<p> Install all files under the directory <em class="replaceable"><code>PREFIX</code></em>
instead of <code class="filename">/usr/local/pgsql</code>. The actual
files will be installed into various subdirectories; no files
will ever be installed directly into the
<em class="replaceable"><code>PREFIX</code></em> directory.
</p>
<p> If you have special needs, you can also customize the
individual subdirectories with the following options. However,
if you leave these with their defaults, the installation will be
relocatable, meaning you can move the directory after
installation. (The <code class="literal">man</code> and <code class="literal">doc</code>
locations are not affected by this.)
</p>
<p> For relocatable installs, you might want to use
<code class="filename">configure</code>'s <code class="literal">--disable-rpath</code>
option. Also, you will need to tell the operating system how
to find the shared libraries.
</p>
</dd>
<dt><span class="term"><code class="option">--exec-prefix=<em class="replaceable"><code>EXEC-PREFIX</code></em></code></span></dt>
<dd><p> You can install architecture-dependent files under a
different prefix, <em class="replaceable"><code>EXEC-PREFIX</code></em>, than what
<em class="replaceable"><code>PREFIX</code></em> was set to. This can be useful to
share architecture-independent files between hosts. If you
omit this, then <em class="replaceable"><code>EXEC-PREFIX</code></em> is set equal to
<em class="replaceable"><code>PREFIX</code></em> and both architecture-dependent and
independent files will be installed under the same tree,
which is probably what you want.
</p></dd>
<dt><span class="term"><code class="option">--bindir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt>
<dd><p> Specifies the directory for executable programs. The default
is <code class="filename"><em class="replaceable"><code>EXEC-PREFIX</code></em>/bin</code>, which
normally means <code class="filename">/usr/local/pgsql/bin</code>.
</p></dd>
<dt><span class="term"><code class="option">--datadir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt>
<dd><p> Sets the directory for read-only data files used by the
installed programs. The default is
<code class="filename"><em class="replaceable"><code>PREFIX</code></em>/share</code>. Note that this has
nothing to do with where your database files will be placed.
</p></dd>
<dt><span class="term"><code class="option">--sysconfdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt>
<dd><p> The directory for various configuration files,
<code class="filename"><em class="replaceable"><code>PREFIX</code></em>/etc</code> by default.
</p></dd>
<dt><span class="term"><code class="option">--libdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt>
<dd><p> The location to install libraries and dynamically loadable
modules. The default is
<code class="filename"><em class="replaceable"><code>EXEC-PREFIX</code></em>/lib</code>.
</p></dd>
<dt><span class="term"><code class="option">--includedir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt>
<dd><p> The directory for installing C and C++ header files. The
default is <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/include</code>.
</p></dd>
<dt><span class="term"><code class="option">--mandir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt>
<dd><p> The man pages that come with <span class="productname">PostgreSQL</span> will be installed under
this directory, in their respective
<code class="filename">man<em class="replaceable"><code>x</code></em></code> subdirectories.
The default is <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/man</code>.
</p></dd>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">--with-docdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--without-docdir</code></span>
</dt>
<dd><p> Documentation files, except “<span class="quote">man</span>” pages, will be
installed into this directory. The default is
<code class="filename"><em class="replaceable"><code>PREFIX</code></em>/doc</code>. If the option
<code class="option">--without-docdir</code> is specified, the
documentation will not be installed by <code class="command">make
install</code>. This is intended for packaging scripts
that have special methods for installing documentation.
</p></dd>
</dl></div>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p> Care has been taken to make it possible to install
<span class="productname">PostgreSQL</span> into shared installation locations
(such as <code class="filename">/usr/local/include</code>) without
interfering with the namespace of the rest of the system. First,
the string “<span class="quote"><code class="literal">/postgresql</code></span>” is
automatically appended to <code class="varname">datadir</code>,
<code class="varname">sysconfdir</code>, and <code class="varname">docdir</code>,
unless the fully expanded directory name already contains the
string “<span class="quote"><code class="literal">postgres</code></span>” or
“<span class="quote"><code class="literal">pgsql</code></span>”. For example, if you choose
<code class="filename">/usr/local</code> as prefix, the documentation will
be installed in <code class="filename">/usr/local/doc/postgresql</code>,
but if the prefix is <code class="filename">/opt/postgres</code>, then it
will be in <code class="filename">/opt/postgres/doc</code>. The public C
header files of the client interfaces are installed into
<code class="varname">includedir</code> and are namespace-clean. The
internal header files and the server header files are installed
into private directories under <code class="varname">includedir</code>. See
the documentation of each interface for information about how to
get at the its header files. Finally, a private subdirectory will
also be created, if appropriate, under <code class="varname">libdir</code>
for dynamically loadable modules.
</p>
</div>
<p>
</p>
<p> </p>
<div class="variablelist"><dl>
<dt><span class="term"><code class="option">--with-includes=<em class="replaceable"><code>DIRECTORIES</code></em></code></span></dt>
<dd>
<p> <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of
directories that will be added to the list the compiler
searches for header files. If you have optional packages
(such as GNU <span class="application">Readline</span>) installed in a non-standard
location,
you have to use this option and probably also the corresponding
<code class="option">--with-libraries</code> option.
</p>
<p> Example: <code class="literal">--with-includes=/opt/gnu/include:/usr/sup/include</code>.
</p>
</dd>
<dt><span class="term"><code class="option">--with-libraries=<em class="replaceable"><code>DIRECTORIES</code></em></code></span></dt>
<dd>
<p> <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of
directories to search for libraries. You will probably have
to use this option (and the corresponding
<code class="option">--with-includes</code> option) if you have packages
installed in non-standard locations.
</p>
<p> Example: <code class="literal">--with-libraries=/opt/gnu/lib:/usr/sup/lib</code>.
</p>
</dd>
<dt><span class="term"><code class="option">--enable-nls[<span class="optional">=<em class="replaceable"><code>LANGUAGES</code></em></span>]</code></span></dt>
<dd>
<p> Enables Native Language Support (<acronym class="acronym">NLS</acronym>),
that is, the ability to display a program's messages in a
language other than English.
<em class="replaceable"><code>LANGUAGES</code></em> is a space-separated
list of codes of the languages that you want supported, for
example <code class="literal">--enable-nls='de fr'</code>. (The intersection
between your list and the set of actually provided
translations will be computed automatically.) If you do not
specify a list, then all available translations are
installed.
</p>
<p> To use this option, you will need an implementation of the
<span class="application">Gettext</span> API; see above.
</p>
</dd>
<dt><span class="term"><code class="option">--with-pgport=<em class="replaceable"><code>NUMBER</code></em></code></span></dt>
<dd><p> Set <em class="replaceable"><code>NUMBER</code></em> as the default port number for
server and clients. The default is 5432. The port can always
be changed later on, but if you specify it here then both
server and clients will have the same default compiled in,
which can be very convenient. Usually the only good reason
to select a non-default value is if you intend to run multiple
<span class="productname">PostgreSQL</span> servers on the same machine.
</p></dd>
<dt><span class="term"><code class="option">--with-perl</code></span></dt>
<dd><p> Build the <span class="application">PL/Perl</span> server-side language.
</p></dd>
<dt><span class="term"><code class="option">--with-python</code></span></dt>
<dd><p> Build the <span class="application">PL/Python</span> server-side language.
</p></dd>
<dt><span class="term"><code class="option">--with-tcl</code></span></dt>
<dd><p> Build the <span class="application">PL/Tcl</span> server-side language.
</p></dd>
<dt><span class="term"><code class="option">--with-tclconfig=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt>
<dd><p> Tcl installs the file <code class="filename">tclConfig.sh</code>, which
contains configuration information needed to build modules
interfacing to Tcl. This file is normally found automatically
at a well-known location, but if you want to use a different
version of Tcl you can specify the directory in which to look
for it.
</p></dd>
<dt><span class="term"><code class="option">--with-krb5</code></span></dt>
<dd><p> Build with support for Kerberos 5 authentication. On many
systems, the Kerberos system is not installed in a location
that is searched by default (e.g., <code class="filename">/usr/include</code>,
<code class="filename">/usr/lib</code>), so you must use the options
<code class="option">--with-includes</code> and <code class="option">--with-libraries</code> in
addition to this option. <code class="filename">configure</code> will check
for the required header files and libraries to make sure that
your Kerberos installation is sufficient before proceeding.
</p></dd>
<dt><span class="term"><code class="option">--with-krb-srvnam=<em class="replaceable"><code>NAME</code></em></code></span></dt>
<dd><p> The default name of the Kerberos service principal.
<code class="literal">postgres</code> is the default. There's usually no
reason to change this.
</p></dd>
<dt><span class="term"><code class="option">--with-openssl</code></span></dt>
<dd><p> Build with support for <acronym class="acronym">SSL</acronym> (encrypted)
connections. This requires the <span class="productname">OpenSSL</span>
package to be installed. <code class="filename">configure</code> will check
for the required header files and libraries to make sure that
your <span class="productname">OpenSSL</span> installation is sufficient
before proceeding.
</p></dd>
<dt><span class="term"><code class="option">--with-pam</code></span></dt>
<dd><p> Build with <acronym class="acronym">PAM</acronym><a name="id636485"></a>
(Pluggable Authentication Modules) support.
</p></dd>
<dt><span class="term"><code class="option">--without-readline</code></span></dt>
<dd><p> Prevents use of the <span class="application">Readline</span> library. This disables
command-line editing and history in
<span class="application">psql</span>, so it is not recommended.
</p></dd>
<dt><span class="term"><code class="option">--with-bonjour</code></span></dt>
<dd><p> Build with Bonjour support. This requires Bonjour support
in your operating system. Recommended on Mac OS X.
</p></dd>
<dt><span class="term"><code class="option">--enable-integer-datetimes</code></span></dt>
<dd><p> Use 64-bit integer storage for datetimes and intervals, rather
than the default floating-point storage. This reduces the range
of representable values but guarantees microsecond precision across
the full range (see
<a href="datatype-datetime.html" title="8.5.Date/Time Types">Section8.5, “Date/Time Types”</a>
for more information). Note also that the integer datetimes code is
newer than the floating-point code, and we still find bugs in it from
time to time.
</p></dd>
<dt><span class="term"><code class="option">--disable-spinlocks</code></span></dt>
<dd><p> Allow the build to succeed even if <span class="productname">PostgreSQL</span>
has no CPU spinlock support for the platform. The lack of
spinlock support will result in poor performance; therefore,
this option should only be used if the build aborts and
informs you that the platform lacks spinlock support. If this
option is required to build <span class="productname">PostgreSQL</span> on
your platform, please report the problem to the
<span class="productname">PostgreSQL</span> developers.
</p></dd>
<dt><span class="term"><code class="option">--enable-thread-safety</code></span></dt>
<dd><p> Make the client libraries thread-safe. This allows
concurrent threads in <span class="application">libpq</span> and
<span class="application">ECPG</span> programs to safely control
their private connection handles. This option requires adequate
threading support in your operating system.
</p></dd>
<dt><span class="term"><code class="option">--without-zlib</code></span></dt>
<dd><p> <a name="id636625"></a>
Prevents use of the <span class="application">Zlib</span> library. This disables
support for compressed archives in <span class="application">pg_dump</span>
and <span class="application">pg_restore</span>.
This option is only intended for those rare systems where this
library is not available.
</p></dd>
<dt><span class="term"><code class="option">--enable-debug</code></span></dt>
<dd><p> Compiles all programs and libraries with debugging symbols.
This means that you can run the programs through a debugger
to analyze problems. This enlarges the size of the installed
executables considerably, and on non-GCC compilers it usually
also disables compiler optimization, causing slowdowns. However,
having the symbols available is extremely helpful for dealing
with any problems that may arise. Currently, this option is
recommended for production installations only if you use GCC.
But you should always have it on if you are doing development work
or running a beta version.
</p></dd>
<dt><span class="term"><code class="option">--enable-cassert</code></span></dt>
<dd><p> Enables <em class="firstterm">assertion</em> checks in the server, which test for
many “<span class="quote">can't happen</span>” conditions. This is invaluable for
code development purposes, but the tests slow things down a little.
Also, having the tests turned on won't necessarily enhance the
stability of your server! The assertion checks are not categorized
for severity, and so what might be a relatively harmless bug will
still lead to server restarts if it triggers an assertion
failure. Currently, this option is not recommended for
production use, but you should have it on for development work
or when running a beta version.
</p></dd>
<dt><span class="term"><code class="option">--enable-depend</code></span></dt>
<dd><p> Enables automatic dependency tracking. With this option, the
makefiles are set up so that all affected object files will
be rebuilt when any header file is changed. This is useful
if you are doing development work, but is just wasted overhead
if you intend only to compile once and install. At present,
this option will work only if you use GCC.
</p></dd>
</dl></div>
<p>
</p>
<p> If you prefer a C compiler different from the one
<code class="filename">configure</code> picks, you can set the
environment variable <code class="envar">CC</code> to the program of your choice.
By default, <code class="filename">configure</code> will pick
<code class="filename">gcc</code> if available, else the platform's
default (usually <code class="filename">cc</code>). Similarly, you can override the
default compiler flags if needed with the <code class="envar">CFLAGS</code> variable.
</p>
<p> You can specify environment variables on the
<code class="filename">configure</code> command line, for example:
</p>
<pre class="screen"><strong class="userinput"><code>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</code></strong></pre>
<p>
</p>
</li>
<li>
<p class="title"><b>Build</b></p>
<p> To start the build, type
</p>
<pre class="screen"><strong class="userinput"><code>gmake</code></strong></pre>
<p>
(Remember to use <acronym class="acronym">GNU</acronym> <span class="application">make</span>.) The build
may take anywhere from 5 minutes to half an hour depending on your
hardware. The last line displayed should be
</p>
<pre class="screen">All of PostgreSQL is successfully made. Ready to install.</pre>
<p>
</p>
</li>
<li>
<p class="title"><b>Regression Tests</b></p>
<a name="id636831"></a><p> If you want to test the newly built server before you install it,
you can run the regression tests at this point. The regression
tests are a test suite to verify that <span class="productname">PostgreSQL</span>
runs on your machine in the way the developers expected it
to. Type
</p>
<pre class="screen"><strong class="userinput"><code>gmake check</code></strong></pre>
<p>
(This won't work as root; do it as an unprivileged user.)
<a href="regress.html" title="Chapter27.Regression Tests">Chapter27, <i>Regression Tests</i></a> contains
detailed information about interpreting the test results. You can
repeat this test at any later time by issuing the same command.
</p>
</li>
<li>
<a name="install"></a><p class="title"><b>Installing The Files</b></p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p> If you are upgrading an existing system and are going to install
the new files over the old ones, be sure to back up
your data and shut down the old server before proceeding, as explained in
<a href="install-upgrading.html" title="14.4.If You Are Upgrading">Section14.4, “If You Are Upgrading”</a> above.
</p>
</div>
<p> To install <span class="productname">PostgreSQL</span> enter
</p>
<pre class="screen"><strong class="userinput"><code>gmake install</code></strong></pre>
<p>
This will install files into the directories that were specified
in <a href="install-procedure.html#configure" title="Step 1">Step 1</a>. Make sure that you have appropriate
permissions to write into that area. Normally you need to do this
step as root. Alternatively, you could create the target
directories in advance and arrange for appropriate permissions to
be granted.
</p>
<p> You can use <code class="literal">gmake install-strip</code> instead of
<code class="literal">gmake install</code> to strip the executable files and
libraries as they are installed. This will save some space. If
you built with debugging support, stripping will effectively
remove the debugging support, so it should only be done if
debugging is no longer needed. <code class="literal">install-strip</code>
tries to do a reasonable job saving space, but it does not have
perfect knowledge of how to strip every unneeded byte from an
executable file, so if you want to save all the disk space you
possibly can, you will have to do manual work.
</p>
<p> The standard installation provides all the header files needed for client
application development as well as for server-side program
development, such as custom functions or data types written in C.
(Prior to <span class="productname">PostgreSQL</span> 8.0, a separate <code class="literal">gmake
install-all-headers</code> command was needed for the latter, but this
step has been folded into the standard install.)
</p>
<p><b>Client-only installation:</b> If you want to install only the client applications and
interface libraries, then you can use these commands:
</p>
<pre class="screen"><strong class="userinput"><code>gmake -C src/bin install</code></strong>
<strong class="userinput"><code>gmake -C src/include install</code></strong>
<strong class="userinput"><code>gmake -C src/interfaces install</code></strong>
<strong class="userinput"><code>gmake -C doc install</code></strong></pre>
<p>
</p>
</li>
</ol></div>
<p><b>Registering <span class="application">eventlog</span> on <span class="systemitem">Windows</span>:</b> To register a <span class="systemitem">Windows</span> <span class="application">eventlog</span>
library with the operating system, issue this command after installation:
</p>
<pre class="screen"><strong class="userinput"><code>regsvr32 <em class="replaceable"><code>pgsql_library_directory</code></em>/pgevent.dll</code></strong></pre>
<p>
This creates registry entries used by the event viewer.
</p>
<p><b>Uninstallation:</b> To undo the installation use the command <code class="command">gmake
uninstall</code>. However, this will not remove any created directories.
</p>
<p><b>Cleaning:</b> After the installation you can make room by removing the built
files from the source tree with the command <code class="command">gmake
clean</code>. This will preserve the files made by the <code class="command">configure</code>
program, so that you can rebuild everything with <code class="command">gmake</code>
later on. To reset the source tree to the state in which it was
distributed, use <code class="command">gmake distclean</code>. If you are going to
build for several platforms within the same source tree you must do
this and re-configure for each build. (Alternatively, use
a separate build tree for each platform, so that the source tree
remains unmodified.)
</p>
<p> If you perform a build and then discover that your <code class="command">configure</code>
options were wrong, or if you change anything that <code class="command">configure</code>
investigates (for example, software upgrades), then it's a good
idea to do <code class="command">gmake distclean</code> before reconfiguring and
rebuilding. Without this, your changes in configuration choices
may not propagate everywhere they need to.
</p>
</div></body>
</html>
|