]> granicus.if.org Git - postgresql/blob - doc/src/sgml/installation.sgml
Startup is actually start-up.
[postgresql] / doc / src / sgml / installation.sgml
1 <!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.16 2000/08/29 20:02:07 momjian Exp $ -->
2
3 <chapter id="installation">
4  <title><![%flattext-install-include[<productname>PostgreSQL</> ]]>Installation Instructions</title>
5
6  <sect1 id="short">
7   <title>Short Version</title>
8
9   <para>
10 <programlisting>
11 ./configure
12 gmake
13 gmake install
14 adduser postgres
15 su - postgres
16 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
17 /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data &gt;logfile 2&gt;&amp;1 &amp;
18 /usr/local/pgsql/bin/createdb test
19 /usr/local/pgsql/bin/psql test
20 </programlisting>
21    The long version is the rest of this
22    <![%flattext-install-include;[document.]]>
23    <![%flattext-install-ignore;[chapter.]]>
24   </para>
25  </sect1>
26
27
28  <sect1 id="requirements">
29   <title>Requirements</title>
30
31   <para>
32    In general, a modern Unix-compatible platform should be able to run
33    PostgreSQL. The platforms that had received explicit testing at the
34    time of release are listed in <xref linkend="supported-platforms">
35    below. In the <filename>doc</> subdirectory of the distribution
36    there are several platform-specific <acronym>FAQ</> documents you
37    might wish to consult if you are having trouble.
38   </para>
39
40   <formalpara>
41    <title>Compiler</>
42    <para>
43     You need a Standard (<quote>ANSI</>) C compiler. Recent versions
44     of <productname>GCC</> are recommendable, but <productname>PostgreSQL</> is known to
45     build with a wide variety of compilers from different vendors.
46    </para>
47   </formalpara>
48     
49   <formalpara>
50    <title>Make</title>
51    <para>
52     Building <productname>PostgreSQL</> requires <acronym>GNU</> <application>make</>; it
53     will <emphasis>not</> work with other <application>make</>
54     programs. <acronym>GNU</> <application>make</> is often installed
55     under the name <filename>gmake</filename>. This document will
56     always refer to it by that name. (On GNU/Linux systems GNU make is
57     the default tool with the name <filename>make</filename>.) To test
58     for <acronym>GNU</acronym> <application>make</application> enter
59 <screen>
60 <userinput>gmake --version</userinput>
61 </screen>
62     If at all possible you should try to use version 3.76.1 or later.
63     If you need to get <acronym>GNU</acronym>
64     <application>make</application>, you can find it at your local
65     <acronym>GNU</acronym> mirror site (see <ulink
66     url="http://www.gnu.org/order/ftp.html">http://www.gnu.org/order/ftp.html</>)
67     or at <ulink
68     url="ftp://ftp.gnu.org/gnu/make">ftp://ftp.gnu.org/gnu/make</ulink>.
69    </para>
70   </formalpara>
71
72   <formalpara>
73    <title>Resources</>
74    <para>
75     Check that you have sufficient disk space. You will need about 30
76     MB for the source tree during compilation and about 5 MB for the
77     installation directory. An empty database takes about 1 MB, later
78     it takes about five times the amount of space that a flat text
79     file with the same data would take. If you are going to run the
80     regression tests you will temporarily need an extra 20 MB. Use the
81     <command>df</command> command to check for disk space.
82    </para>
83   </formalpara>
84  </sect1>
85
86 <![%flattext-install-ignore;[
87  <sect1>
88   <title>Getting The Source</title>
89
90   <para>
91    The <productname>PostgreSQL</> &version; sources can by obtained from <ulink
92    url="ftp://ftp.postgresql.org/pub/postgresql-&version;.tar.gz"
93    >ftp://ftp.postgresql.org/pub/postgresql-&version;.tar.gz</ulink>.
94    Use a mirror if possible. Then unpack it:
95 <screen>
96 <userinput>gunzip postgresql-&version;.tar.gz</userinput>
97 <userinput>tar xf postgresql-&version;.tar</userinput>
98 </screen>
99    This will create a directory
100    <filename>postgresql-&version;</filename> with the <productname>PostgreSQL</> sources
101    in the current directory. Change into that directory for the rest
102    of the installation procedure.
103   </para>
104  </sect1>
105 ]]>
106
107  <sect1 id="install-upgrading">
108   <title>If You Are Upgrading</title>
109
110   <para>
111    The internal data storage format changes with new releases of
112    <productname>PostgreSQL</>. Therefore, if you are upgrading an existing installation
113    that does not have a version number
114    <quote>&majorversion;.x</quote>, you must back up and restore your
115    data as shown here. These instructions assume that your existing
116    installation is under the <filename>/usr/local/pgsql</> directory,
117    and that the data area is in <filename>/usr/local/pgsql/data</>.
118    Substitute your paths appropriately.
119   </para>
120
121   <procedure>
122    <step>
123     <para>
124      Make sure that your database is not updated during or after the
125      backup. This does not affect the integrity of the backup, but the
126      changed data would of course not be included. If necessary, edit
127      the permissions in the file
128      <filename>/usr/local/pgsql/data/pg_hba.conf</> (or equivalent) to
129      disallow access from everyone except you.
130     </para>
131    </step>
132
133    <step>
134     <para>
135      To dump your database installation, type:
136 <screen>
137 <userinput>pg_dumpall &gt; <replaceable>outputfile</></userinput>
138 </screen>
139      If you need to preserve the oids (such as when using them as
140      foreign keys), then use the -o option when running
141      <application>pg_dumpall</>.
142     </para>
143
144     <para>
145      Make sure that you use the <application>pg_dumpall</> command
146      from the version you are currently running. &version;'s
147      <application>pg_dumpall</> should not be used on older databases.
148     </para>
149    </step>
150
151    <step>
152     <para>
153      If you are installing the new version at the same location as the
154      old one then shut down the old server, at the latest before you
155      install the new files:
156 <screen>
157 <userinput>kill -INT `cat /usr/local/pgsql/data/postmaster.pid`</>
158 </screen>
159      Versions prior to 7.0 do not have this
160      <filename>postmaster.pid</> file. If you are using such a version
161      you must find out the process id of the server yourself, for
162      example by typing <userinput>ps ax | grep postmaster</>, and
163      supply it to the <command>kill</> command.
164     </para>
165
166     <para>
167      On systems which have <productname>PostgreSQL</> started at boot time, there is
168      probably a start-up file that will accomplish the same thing. For
169      example, on a Redhat Linux system one might find that
170 <programlisting>
171 /etc/rc.d/init.d/postgres.init stop
172 </programlisting>
173      works.
174     </para>
175    </step>
176
177    <step>
178     <para>
179      If you are installing in the same place as the old version then
180      it is also a good idea to move the old installation out of the
181      way, in case you still need it later on. Use a command like this:
182 <screen>
183 <userinput>mv /usr/local/pgsql /usr/local/pgsql.old</>
184 </screen>
185     </para>
186    </step>
187   </procedure>
188
189   <para>
190    After you have installed <productname>PostgreSQL</> &version;, create a new database
191    directory and start the new server. Remember that you must execute
192    these commands while logged in to the special database user account
193    (which you already have if you are upgrading).
194 <programlisting>
195 <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/bin</>
196 <userinput>/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/bin</>
197 </programlisting>
198    Finally, restore your data with
199 <screen>
200 <userinput>/usr/local/pgsql/bin/psql -d template1 -f <replaceable>outputfile</></userinput>
201 </screen>
202    using the <emphasis>new</> <application>psql</>.
203   </para>
204
205   <para>
206    You can also install the new version in parallel with the old one
207    to decrease the downtime. These topics are discussed at length in
208    <![%flattext-install-include[the <citetitle>Administrator's Guide</>,]]>
209    <![%flattext-install-ignore[<xref linkend="migration">,]]>
210    which you are encouraged
211    to read in any case. The <application>pg_upgrade</> utility can
212    also often be used.
213   </para>
214  </sect1>
215
216
217  <sect1>
218   <title>Installation Procedure</title>
219
220   <procedure>
221
222   <step id="configure">
223    <title>Configuration</>
224    <para>
225     The first step of the installation procedure is to configure the
226     source tree for your system and choose the options you would like.
227     This is done by running the <filename>configure</> script. For a
228     default installation simply type
229 <screen>
230 <userinput>./configure</userinput>
231 </screen>
232     This script will run a number of tests to guess values for various
233     system dependent variables and detect some quirks of your
234     operating system, and finally creates several files in the build
235     tree to record what it found.
236    </para>
237
238    <para>
239     The default configuration will build the server and utilities, as
240     well as all client applications and interfaces that only require a
241     C compiler. All files will be installed under
242     <filename>/usr/local/pgsql</> by default.
243    </para>
244
245    <para>
246     You can customize the build and installation process by giving one
247     or more of the following command line options to
248     <filename>configure</filename>:
249
250      <variablelist>
251       <varlistentry>
252        <term>--prefix=<replaceable>PREFIX</></term>
253        <listitem>
254         <para>
255          Install all files under the directory <replaceable>PREFIX</>
256          instead of <filename>/usr/local/pgsql</filename>. The actual
257          files will be installed into various subdirectories; no files
258          will ever be installed directly into the
259          <replaceable>PREFIX</> directory.
260         </para>
261
262         <para>
263          If you have special needs, you can also customize the
264          individual subdirectories with the following options.
265         </para>
266        </listitem>
267       </varlistentry>
268
269       <varlistentry>
270        <term>--exec-prefix=<replaceable>EXEC-PREFIX</></term>
271        <listitem>
272         <para>
273          You can install architecture-dependent files under a
274          different prefix, <replaceable>EXEC-PREFIX</>, than what
275          <replaceable>PREFIX</> was set to. This can be useful to
276          share architecture-independent files between hosts. If you
277          omit this, then <replaceable>EXEC-PREFIX</> is set equal to
278          <replaceable>PREFIX</> and both architecture dependent and
279          independent files will be installed under the same tree,
280          which is probably what you want.
281         </para>
282        </listitem>
283       </varlistentry>
284
285       <varlistentry>
286        <term>--bindir=<replaceable>DIRECTORY</></term>
287        <listitem>
288         <para>
289          Specifies the directory for executable programs. The default
290          is <filename><replaceable>EXEC-PREFIX</>/bin</>, which
291          normally means <filename>/usr/local/pgsql/bin</>.
292         </para>
293        </listitem>
294       </varlistentry>
295
296       <varlistentry>
297        <term>--datadir=<replaceable>DIRECTORY</></term>
298        <listitem>
299         <para>
300          Sets the directory for read-only data files used by the
301          installed programs. The default is
302          <filename><replaceable>PREFIX</>/share</>. Note that this has
303          nothing to do with where your database files will be placed.
304         </para>
305        </listitem>
306       </varlistentry>
307
308       <varlistentry>
309        <term>--sysconfdir=<replaceable>DIRECTORY</></term>
310        <listitem>
311         <para>
312          The directory for various configuration files,
313          <filename><replaceable>PREFIX</>/etc</> by default.
314         </para>
315        </listitem>
316       </varlistentry>
317
318       <varlistentry>
319        <term>--libdir=<replaceable>DIRECTORY</></term>
320        <listitem>
321         <para>
322          The location to install libraries and dynamically loadable
323          modules. The default is
324          <filename><replaceable>EXEC-PREFIX</>/lib</>.
325         </para>
326        </listitem>
327       </varlistentry>
328
329       <varlistentry>
330        <term>--includedir=<replaceable>DIRECTORY</></term>
331        <listitem>
332         <para>
333          The directory for installing C and C++ header files. The
334          default is <filename><replaceable>PREFIX</>/include</>.
335         </para>
336        </listitem>
337       </varlistentry>
338
339       <varlistentry>
340        <term>--docdir=<replaceable>DIRECTORY</></term>
341        <listitem>
342         <para>
343          Documentation files, except <quote>man</> pages, will be
344          installed into this directory. The default is
345          <filename><replaceable>PREFIX</>/doc</>.
346         </para>
347        </listitem>
348       </varlistentry>
349
350       <varlistentry>
351        <term>--mandir=<replaceable>DIRECTORY</></term>
352        <listitem>
353         <para>
354          The man pages that come with <productname>PostgreSQL</> will be installed under
355          this directory, in their respective
356          <filename>man<replaceable>x</></> subdirectories.
357          <filename><replaceable>PREFIX</>/man</>.
358         </para>
359        </listitem>
360       </varlistentry>
361
362       <varlistentry>
363        <term>--with-includes=<replaceable>DIRECTORIES</></term>
364        <listitem>
365         <para>
366          <replaceable>DIRECTORIES</> is a colon-separated list of
367          directories that will be added to the list the compiler
368          searches for header files. If you have optional packages
369          (such as GNU Readline) installed in a non-standard location
370          you have to use this option and probably the corresponding
371          <option>--with-libraries</> option.
372         </para>
373         <para>
374          Example: <literal>--with-includes=/opt/gnu/include:/usr/sup/include</>.
375         </para>
376        </listitem>
377       </varlistentry>
378
379       <varlistentry>
380        <term>--with-libraries=<replaceable>DIRECTORIES</></term>
381        <listitem>
382         <para>
383          <replaceable>DIRECTORIES</> is a colon-separated list of
384          directories to search for libraries. You will probably have
385          to use this option (and the corresponding
386          <option>--with-includes</> option) if you have packages
387          installed in non-standard locations.
388         </para>
389         <para>
390          Example: <literal>--with-libraries=/opt/gnu/lib:/usr/sup/lib</>.
391         </para>
392        </listitem>
393       </varlistentry>
394
395       <varlistentry>
396        <term>--enable-locale</term>
397        <listitem>
398         <para>
399          Enables locale support. There is a performance penalty
400          associated with locale support, but if you are not in an
401          English-speaking environment you will most likely need this.
402         </para>
403        </listitem>
404       </varlistentry>
405
406       <varlistentry>
407        <term>--enable-recode</term>
408        <listitem>
409         <para>
410          Enables character set recode support. See
411          <filename>doc/README.Charsets</> for details on this feature.
412         </para>
413        </listitem>
414       </varlistentry>
415
416       <varlistentry>
417        <term>--enable-multibyte</term>
418        <listitem>
419         <para>
420          Allows the use of multibyte character encodings. This is
421          primarily for languages like Japanese, Korean, and Chinese.
422          Read <filename>doc/README.mb</> for details.
423         </para>
424        </listitem>
425       </varlistentry>
426
427       <varlistentry>
428        <term>--with-pgport=<replaceable>NUMBER</></term>
429        <listitem>
430         <para>
431          Set <replaceable>NUMBER</> as the default port number for
432          server and clients. The default is 5432. The port can always
433          be changed later on, but if you specify it here then both
434          server and clients will have the same default compiled in,
435          which can be very convenient.
436         </para>
437        </listitem>
438       </varlistentry>
439
440       <varlistentry>
441        <term>--with-CXX</term>
442        <listitem>
443         <para>
444          Build the C++ interface library. <filename>configure</> will
445          automatically pick the C++ compiler that goes with the C
446          compiler you are using. It is not recommended or supported to
447          use C and C++ compilers of different origin in the same
448          build.
449         </para>
450        </listitem>
451       </varlistentry>
452
453       <varlistentry>
454        <term>--with-perl</term>
455        <listitem>
456         <para>
457          Build the Perl interface module. The Perl interface
458          will be installed at the usual place for Perl modules
459          (typically under <filename>/usr/lib/perl</filename>), so you
460          must have root access to perform the installation step (see
461          <xref linkend="install">). You need to have Perl 5 installed to
462          use this option.
463         </para>
464        </listitem>
465       </varlistentry>
466
467       <varlistentry>
468        <term>--with-python</term>
469        <listitem>
470         <para>
471          Build the Python interface module. You need to have root
472          access to be able to install the Python module at its default
473          place
474          (<filename>/usr/lib/python<replaceable>x</>.<replaceable>y</></>).
475          To be able to use this option, you must have Python installed
476          and your system needs to support shared libraries. If you
477          instead want to build a new complete interpreter binary, you
478          will have to do it manually.
479         </para>
480        </listitem>
481       </varlistentry>
482
483       <varlistentry>
484        <term>--with-tcl</term>
485        <listitem>
486         <para>
487          Builds components that require Tcl, which are libpgtcl,
488          pgtclsh, and PL/Tcl.
489         </para>
490        </listitem>
491       </varlistentry>
492
493       <varlistentry>
494        <term>--with-x</term>
495        <listitem>
496         <para>
497          Use the X Window System. If you specified --with-tcl then this
498          will enable the build of modules requiring Tcl/Tk, that is,
499          pgtksh and pgaccess.
500         </para>
501        </listitem>
502       </varlistentry>
503
504       <varlistentry>
505        <term>--with-tclconfig=<replaceable>DIRECTORY</replaceable></term>
506        <term>--with-tkconfig=<replaceable>DIRECTORY</replaceable></term>
507        <listitem>
508         <para>
509          Tcl/Tk installs the files <filename>tclConfig.sh</filename> and
510          <filename>tkConfig.sh</filename> which contain certain
511          configuration information that is needed to build modules
512          interfacing to Tcl or Tk. These files are normally found
513          automatically at their well-known location, but if you want to
514          use a different version of Tcl or Tk you can specify the
515          directory where to find them.
516         </para>
517        </listitem>
518       </varlistentry>
519
520       <varlistentry>
521        <term>--enable-odbc</term>
522        <listitem>
523         <para>
524          Build the ODBC driver package.
525         </para>
526        </listitem>
527       </varlistentry>
528
529       <varlistentry>
530        <term>--with-odbcinst=<replaceable>DIRECTORY</></term>
531        <listitem>
532         <para>
533          Specifies the directory where the ODBC driver will expect its
534          <filename>odbcinst.ini</> configuration file. The default is
535          <filename>/usr/local/pgsql/etc</filename> or whatever you
536          specified as <option>--sysconfdir</option>. A default file
537          will be installed there.
538         </para>
539        </listitem>
540       </varlistentry>
541
542       <varlistentry>
543        <term>--with-krb4=<replaceable>DIRECTORY</></term>
544        <term>--with-krb5=<replaceable>DIRECTORY</></term>
545        <listitem>
546         <para>
547          Build with suppport for Kerberos authentication. You can use
548          either Kerberos version 4 or 5, but not both. The
549          <replaceable>DIRECTORY</> argument specifies the root
550          directory of the Kerberos installation;
551          <filename>/usr/athena</> is assumed as default. If the
552          relevant headers files and libraries are not under a common
553          parent directory, then you must use the
554          <option>--with-includes</> and <option>--with-libraries</>
555          options in addition to this option. If, on the other hand,
556          the required files are in a location that is searched by
557          default (e.g., <filename>/usr/lib</>), then you can leave off
558          the argument.
559         </para>
560
561         <para>
562          <filename>configure</> will check for the required header
563          files and libraries to make sure that your Kerberos
564          installation is sufficient before proceeding.
565         </para>
566        </listitem>
567       </varlistentry>
568
569       <varlistentry>
570        <term>--with-krb-srvnam=<replaceable>NAME</></term>
571        <listitem>
572         <para>
573          The name of the Kerberos service principal.
574          <quote>postgres</quote> is the default. There's probably no
575          reason to change this.
576         </para>
577        </listitem>
578       </varlistentry>
579
580       <varlistentry>
581        <term>--with-openssl=<replaceable>DIRECTORY</></term>
582        <listitem>
583         <para>
584          Build with support for SSL (encrypted) connections. 
585          This requires the OpenSSL library to be installed.
586          The <replaceable>DIRECTORY</> argument specifies the
587          root directory of the OpenSSL installation.
588         </para>
589
590         <para>
591          <filename>configure</> will check for the required header
592          files and libraries to make sure that your OpenSSL
593          installation is sufficient before proceeding.
594         </para>
595        </listitem>
596       </varlistentry>
597
598       <varlistentry>
599        <term>--enable-syslog</term>
600        <listitem>
601         <para>
602          Enables the <productname>PostgreSQL</> server to use the
603          syslog logging facility. (Using this option does not mean
604          that you will have to log with syslog or even that it will be done
605          by default, it simply makes it possible to turn this option
606          on at run time.)
607         </para>
608        </listitem>
609       </varlistentry>
610
611       <varlistentry>
612        <term>--enable-debug</term>
613        <listitem>
614         <para>
615          Compiles all programs and libraries with debugging symbols.
616          This means that you can run the programs through a debugger
617          to analyze problems. This option is not recommended for
618          production use.
619         </para>
620        </listitem>
621       </varlistentry>
622      </variablelist>
623    </para>
624
625    <formalpara>
626     <title>Environment variables</>
627     <para>
628      You can set the <envar>CC</> environment variable to choose the C
629      compiler to use. If you don't then <filename>configure</> will
630      look for one. For example:
631 <screen>
632 <userinput>CC=/opt/bin/gcc ./configure</>
633 </screen>
634     </para>
635    </formalpara>
636     
637   </step>
638
639   <step>
640    <title>Build</title>
641
642    <para>
643     To start the build, type
644 <screen>
645 <userinput>gmake</userinput>
646 </screen>
647     (Remember to use <acronym>GNU</> <application>make</>.) The build
648     can take anywhere from 5 minutes to half an hour. The last line
649     displayed should be
650 <screen>
651 All of PostgreSQL is successfully made. Ready to install.
652 </screen>
653    </para>
654   </step>
655
656   <step>
657    <title>Regression Tests</title>
658
659    <para>
660     If you want to test the newly built server before you install it,
661     you can run the regression tests at this point. The regression
662     tests are a test suite to verify that <productname>PostgreSQL</> runs on your machine
663     in the way the developers expected it to. Type
664 <screen>
665 <userinput>gmake -C src/test/regress all runcheck</userinput>
666 <!-- XXX How about just `gmake check'? -->
667 </screen>
668     It is possible that some tests fail, due to differences in error
669     message wording or floating point results. The file
670     <filename>src/test/regress/README</> and
671     <![%flattext-install-include[the <citetitle>Administrator's Guide</citetitle>]]>
672     <![%flattext-install-ignore[<xref linkend="regress">]]>
673     contain detailed
674     information about interpreting the test results. You can repeat
675     this test at any later time by issuing the same command.
676    </para>
677   </step>
678
679   <step id="install">
680    <title>Installing The Files</title>
681
682    <note>
683     <para>
684      If you are upgrading an existing system and are going to install
685      the new files over the old ones then you should have backed up
686      your data and shut down the old server by now, as explained in
687      <xref linkend="install-upgrading"> above.
688     </para>
689    </note>
690
691    <para>
692     To install <productname>PostgreSQL</> enter
693 <screen>
694 <userinput>gmake install</userinput>
695 </screen>
696     This will install files into the directories that were specified
697     in <xref linkend="configure">. Make sure that you have appropriate
698     permissions to write into that area. Normally you need to do this
699     step as root. Alternatively, you could create the target
700     directories in advance and arrange for appropriate permissions to
701     be granted.
702    </para>
703
704    <para>
705     If you built the Perl or Python interfaces and you were not the
706     root user when you executed the above command then that part of
707     the installation probably failed. In that case you should become
708     the root user and then do
709 <screen>
710 <userinput>gmake -C src/interfaces/perl5 install</userinput>
711 <userinput>gmake -C src/interfaces/python install</userinput>
712 </screen>
713     Due to a quirk in the Perl build environment the first command
714     will actually rebuild the complete interface and then install it.
715     This is not harmful, just unusual. If you do not have superuser
716     access you are on your own: you can still take the required files
717     and place them in other directories where Perl or Python can find
718     them, but how to do that is left as an exercise.
719    </para>
720
721    <formalpara>
722     <title>Client-only installation</title>
723     <para>
724      If you want to install only the client applications and
725      interfaces, then you can use these commands:
726 <screen>
727 <userinput>gmake -C src/bin install</>
728 <userinput>gmake -C src/interfaces install</>
729 <userinput>gmake -C doc install</>
730 </screen>
731     </para>
732    </formalpara>
733
734    <para>
735     To undo the installation use the command <command>gmake
736     uninstall</>. However, this will not remove the Perl and Python
737     interfaces and it will not remove any directories.
738    </para>
739   </step>
740   </procedure>
741
742   <formalpara>
743    <title>Cleanup</>
744    <para>
745     After the installation you can make room by removing the built
746     files from the source tree with the <command>gmake clean</>
747     command. This will preserve the choices made by the configure
748     program, so that you can rebuild everything with <command>gmake</>
749     later on. To reset the source tree to the state in which it was
750     distributed, use <command>gmake distclean</>. If you are going to
751     build for several platforms from the same source tree you must do
752     this and re-configure for each build.
753    </para>
754   </formalpara>  
755
756  </sect1>
757
758  <sect1>
759   <title>Post-Installation Setup</title>
760
761   <sect2>
762    <title>Shared Libraries</title>
763    <para>
764     On most systems that have shared libraries (which most systems do)
765     you need to tell your system how to find the newly installed
766     shared libraries. How to do this varies between platforms, but the
767     most widely usable method is to set the environment variable
768     <envar>LD_LIBRARY_PATH</> like so: In Bourne shells (sh, ksh,
769     bash, zsh)
770 <programlisting>
771 LD_LIBRARY_PATH=/usr/local/pgsql/lib
772 export LD_LIBRARY_PATH
773 </programlisting>
774     or in csh or tcsh
775 <programlisting>
776 setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
777 </programlisting>
778     Replace <literal>/usr/local/pgsql/lib</> with whatever you set
779     <option><literal>--libdir</></> to in <xref linkend="configure">.
780     You should put these commands into a shell start-up file such as
781     <filename>/etc/profile</> or <filename>~/.bash_profile</>.
782    </para>
783
784    <para>
785     On Linux systems the following is the preferred method, but you
786     must have root access. Edit the file <filename>/etc/ld.so.conf</>
787     to add a line
788 <programlisting>
789 <filename>/usr/local/pgsql/lib</>
790 </programlisting>
791     Then run command <command>/sbin/ldconfig</>.
792    </para>
793
794    <para>
795     If in doubt, refer to the manual pages of your system. If you later
796     on get a message like
797 <screen>
798 psql: error in loading shared libraries
799 libpq.so.2.1: cannot open shared object file: No such file or directory
800 </screen>
801     then this step was necessary.  Simply take care of it then.
802    </para>
803   </sect2>
804
805   <sect2>
806    <title>Environment Variables</title>
807    <para>
808     If you installed into <filename>/usr/local/pgsql</> or some other
809     location that is not searched for programs by default, you need to
810     add <filename>/usr/local/pgsql/bin</> (or what you set
811     <option><literal>--bindir</></> to in <xref linkend="configure">)
812     into your <envar>PATH</>. To do this, add the following to your
813     shell start-up file, such as <filename>~/.bash_profile</> (or
814     <filename>/etc/profile</>, if you want it to affect every user):
815 <programlisting>
816 PATH=$PATH:/usr/local/pgsql/bin
817 </programlisting>
818     If you are using csh or tcsh, then use this command:
819 <programlisting>
820 set path = ( /usr/local/pgsql/bin path )
821 </programlisting>
822    </para>
823
824    <para>
825     To enable your system to find the <application>man</>
826     documentation, you need to add a line like the following to a
827     shell start-up file:
828 <programlisting>
829 MANPATH=$MANPATH:/usr/local/pgsql/man
830 </programlisting>
831    </para>
832
833    <para>
834     The environment variables <envar>PGHOST</> and <envar>PGPORT</>
835     specify to client applications the host and port of the database
836     server, overriding the compiled-in defaults. If you are going to
837     run client applications remotely then it is convenient if every
838     user that plans to use the database sets <envar>PGHOST</>, but it
839     is not required and the settings can be communicated via command
840     line options to most client programs.
841    </para>
842   </sect2>
843  </sect1>
844
845
846 <![%flattext-install-include;[
847  <sect1>
848   <title>Getting Started</title>
849
850   <para>
851    The following is a quick summary of how to get <productname>PostgreSQL</> up and
852    running once installed. The <citetitle>Administrator's Guide</>
853    contains more information.
854   </para>
855
856   <procedure>
857    <step>
858     <para>
859      Create the <productname>PostgreSQL</> server account. This is the user the server
860      will run as. For production use you should create a separate,
861      unprivileged account (<quote>postgres</> is commonly used). If
862      you do not have root access or just want to play around, your own
863      user account is enough, but running the server as root is a
864      security risk and therefore not allowed.
865 <screen>
866 <userinput>adduser postgres</>
867 </screen>
868     </para>
869    </step>
870
871    <step>
872     <para>
873      Create a database installation with the <command>initdb</>
874      command. To run <command>initdb</> you must be logged in to your
875      <productname>PostgreSQL</> server account. It will not work as
876      root.
877 <screen>
878 root# <userinput>mkdir /usr/local/pgsql/data</>
879 root# <userinput>chown postgres /usr/local/pgsql/data</>
880 root# <userinput>su - postgres</>
881 postgres$ <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data</>
882 </screen>
883     </para>
884
885     <para>
886      The <option>-D</> option specifies the location where the data
887      will be stored. You can use any path you want, it does not have
888      to be under the installation directory. Just make sure that the
889      server account can write to the directory (or create it, if it
890      doesn't already exist) before starting <command>initdb</>, as
891      illustrated here.
892     </para>
893    </step>
894
895    <step>
896     <para>
897      The previous step should have told you how to start up the
898      database server. Do so now. The command should look something
899      like
900 <programlisting>
901 /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
902 </programlisting>
903      This will start the server in the foreground. To put the server
904      in the background use something like
905 <programlisting>
906 nohup /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data \
907     &lt;/dev/null &gt;&gt;server.log 2&gt;&amp;1 &lt;/dev/null &amp;
908 </programlisting>
909     </para>
910
911     <para>
912      To stop a server running in the background you can type
913 <programlisting>
914 kill `cat /usr/local/pgsql/data/postmaster.pid`
915 </programlisting>
916     </para>
917
918     <para>
919      In order to allow TCP/IP connections (rather than only Unix
920      domain socket ones) you need to pass the <option>-i</> option to
921      <filename>postmaster</>.
922     </para>
923    </step>
924
925    <step>
926     <para>
927      Create a database:
928 <screen>
929 <userinput>createdb testdb</>
930 </screen>
931      Then enter
932 <screen>
933 <userinput>psql testdb</>
934 </screen>
935      to connect to that database. At the prompt you can enter SQL
936      commands and start experimenting.
937     </para>
938    </step>
939   </procedure>
940  </sect1>
941
942  <sect1>
943   <title>What Now?</title>
944
945   <para>
946    <itemizedlist>
947     <listitem>
948      <para>
949       The <citetitle>Tutorial</> should be your first reading if you
950       are completely new to <acronym>SQL</> databases. It should have
951       been installed at
952       <filename>/usr/local/pgsql/doc/tutorial/index.html</> unless you
953       changed the installation directories.
954      </para>
955     </listitem>
956
957     <listitem>
958      <para>
959       If you are familiar with database concepts then you want to
960       proceed with the <citetitle>Administrator's Guide</citetitle>,
961       which contains information about how to set up the database
962       server, database users, and authentication. It can be found at
963       <filename>/usr/local/pgsql/doc/admin/index.html</>.
964      </para>
965     </listitem>
966
967     <listitem>
968      <para>
969       Usually, you will want to modify your computer so that it will
970       automatically start the database server whenever it boots. Some
971       suggestions for this are in the <citetitle>Administrator's
972       Guide</citetitle>.
973      </para>
974     </listitem>
975
976     <listitem>
977      <para>
978       Run the regression tests against the installed server (using the
979       sequential test method). If you didn't run the tests before
980       installation, you should definitely do it now. This is also
981       explained in the <citetitle>Administrator's Guide</citetitle>.
982      </para>
983     </listitem>
984
985    </itemizedlist>
986   </para>
987
988 <!-- do we still ship this? -->
989 <!--
990   <para>
991    The documentation is also available in Postscript format. If you
992    have a Postscript printer, or have your machine already set up to
993    accept Postscript files using a print filter, then to print, for
994    example the <citetitle>User's Guide</> simply type
995 <programlisting>
996 cd /usr/local/pgsql/doc
997 gunzip -c user.ps.gz | lpr
998 </programlisting>
999    Here is how you might do it if you have <productname>Ghostscript</>
1000    installed on your system and are writing to a Laserjet printer.
1001 <programlisting>
1002 gunzip -c user.ps.gz \
1003     | gs -sDEVICE=laserjet -r300 -q -dNOPAUSE -sOutputFile=- \
1004     | lpr
1005 </programlisting>
1006    Printer setups can vary wildly from system to system. If in doubt,
1007    consult your manuals or your local expert.
1008   </para>
1009 -->
1010
1011  </sect1>
1012 ]]>
1013
1014
1015  <sect1 id="supported-platforms">
1016   <title>Supported Platforms</title>
1017
1018   <para>
1019    At the time of release, <productname>PostgreSQL</> &version; has been verified by the
1020    developer community to work on the following platforms. A supported
1021    platform generally means that <productname>PostgreSQL</> builds and installs according
1022    to these instructions and that the regression tests pass, except
1023    for minor differences.
1024   </para>
1025
1026   <note>
1027    <para>
1028     If you are having problems with the installation on a supported
1029     platform, please write to <email>pgsql-bugs@postgresql.org</email>
1030     or <email>pgsql-ports@postgresql.org</email>, not to the people
1031     listed here.
1032    </para>
1033   </note>
1034
1035     <informaltable>
1036      <tgroup cols="4">
1037       <thead>
1038        <row>
1039         <entry><acronym>OS</acronym></entry>
1040         <entry>Processor</entry>
1041         <entry>Version</entry>
1042         <entry>Reported</entry>
1043         <entry>Remarks</entry>
1044        </row>
1045       </thead>
1046       <tbody>
1047        <row>
1048         <entry>AIX 4.3.2</entry>
1049         <entry>RS6000</entry>
1050         <entry>7.0</entry>
1051         <entry>2000-04-05, Andread Zeugswetter (<email>Andreas.Zeugswetter@telecom.at</>)</entry>
1052         <entry>See also <filename>doc/FAQ_AIX</></entry>
1053        </row>
1054        <row>
1055         <entry>BSDI 4.01</entry>
1056         <entry>x86</entry>
1057         <entry>7.0</entry>
1058         <entry>2000-04-04, Bruce Momjian (<email>pgman@candle.pha.pa.us</>)</entry>
1059         <entry></entry>
1060        </row>
1061        <row>
1062         <entry>Compaq Tru64 5.0</entry>
1063         <entry>Alpha</entry>
1064         <entry>7.0</entry>
1065         <entry>2000-04-11, Andrew McMurry (<email>andrew.mcmurry@astro.uio.no</>)</entry>
1066         <entry></>
1067        </row>
1068        <row>
1069         <entry>FreeBSD 4.0</entry>
1070         <entry>x86</entry>
1071         <entry>7.0</entry>
1072         <entry>2000-04-04, Marc Fournier (<email>scrappy@hub.org</>)</entry>
1073         <entry></>
1074        </row>
1075        <row>
1076         <entry>HPUX 9.0x and 10.20</entry>
1077         <entry>PA-RISC</entry>
1078         <entry>7.0</entry>
1079         <entry>2000-04-12, Tom Lane (<email>tgl@sss.pgh.pa.us</>)</entry>
1080         <entry></>
1081        </row>
1082        <row>
1083         <entry>IRIX 6.5.6f</entry>
1084         <entry>MIPS</entry>
1085         <entry>6.5.3</entry>
1086         <entry>2000-02-18, Kevin Wheatley (<email>hxpro@cinesite.co.uk</>)</entry>
1087         <entry>MIPSPro 7.3.1.1m N32 build</entry>
1088        </row>
1089        <row>
1090         <entry>Linux 2.0.x</entry>
1091         <entry>Alpha</entry>
1092         <entry>7.0</entry>
1093         <entry>2000-04-05, Ryan Kirkpatrick (<email>pgsql@rkirkpat.net</>)</entry>
1094         <entry>with published patches</entry>
1095        </row>
1096        <row>
1097         <entry>Linux 2.2.x</entry>
1098         <entry>armv4l</entry>
1099         <entry>7.0</entry>
1100         <entry>2000-04-17, Mark Knox (<email>segfault@hardline.org</>)</entry>
1101         <entry>Regression test needs work.</entry>
1102        </row>
1103        <row>
1104         <entry>Linux 2.2.x</entry>
1105         <entry>x86</entry>
1106         <entry>7.0</entry>
1107         <entry>2000-03-26, Lamar Owen (<email>lamar.owen@wgcr.org</>)</entry>
1108         <entry></>
1109        </row>
1110        <row>
1111         <entry>Linux 2.0.x</entry>
1112         <entry>MIPS</entry>
1113         <entry>7.0</entry>
1114         <entry>2000-04-13, Tatsuo Ishii (<email>t-ishii@sra.co.jp</>)</entry>
1115         <entry>Cobalt Qube</entry>
1116        </row>
1117        <row>
1118         <entry>Linux 2.2.5</entry>
1119         <entry>Sparc</entry>
1120         <entry>7.0</entry>
1121         <entry>2000-04-02, Tom Szybist (<email>szybist@boxhill.com</>)</entry>
1122         <entry></>
1123        </row>
1124        <row>
1125         <entry>LinuxPPC R4</entry>
1126         <entry>PPC603e</entry>
1127         <entry>7.0</entry>
1128         <entry>2000-04-13, Tatsuo Ishii (<email>t-ishii@sra.co.jp</>)</entry>
1129         <entry></>
1130        </row>
1131        <row>
1132         <entry>mklinux</entry>
1133         <entry>PPC750</entry>
1134         <entry>7.0</entry>
1135         <entry>2000-04-13, Tatsuo Ishii (<email>t-ishii@sra.co.jp</>)</entry>
1136         <entry></>
1137        </row>
1138        <row>
1139         <entry>NetBSD 1.4</entry>
1140         <entry>arm32</entry>
1141         <entry>7.0</entry>
1142         <entry>2000-04-08, Patrick Welche (<email>prlw1@newn.cam.ac.uk</>)</entry>
1143         <entry></>
1144        </row>
1145        <row>
1146         <entry>NetBSD 1.4U</entry>
1147         <entry>x86</entry>
1148         <entry>7.0</entry>
1149         <entry>2000-03-26, Patrick Welche (<email>prlw1@newn.cam.ac.uk</>)</entry>
1150         <entry></>
1151        </row>
1152        <row>
1153         <entry>NetBSD</entry>
1154         <entry>m68k</entry>
1155         <entry>7.0</entry>
1156         <entry>2000-04-10, Henry B. Hotz (<email>hotz@jpl.nasa.gov</>)</entry>
1157         <entry>Mac 8xx</entry>
1158        </row>
1159        <row>
1160         <entry>NetBSD</entry>
1161         <entry>Sparc</entry>
1162         <entry>7.0</entry>
1163         <entry>2000-04-13, Tom I. Helbekkmo (<email>tih@kpnQwest.no</>)</entry>
1164         <entry></>
1165        </row>
1166        <row>
1167         <entry>QNX 4.25</entry>
1168         <entry>x86</entry>
1169         <entry>7.0</entry>
1170         <entry>2000-04-01, Dr. Andreas Kardos (<email>kardos@repas-aeg.de</>)</entry>
1171         <entry></>
1172        </row>
1173        <row>
1174         <entry>SCO OpenServer 5</entry>
1175         <entry>x86</entry>
1176         <entry>6.5</entry>
1177         <entry>1999-05-25, Andrew Merrill (<email>andrew@compclass.com</>)</entry>
1178         <entry></>
1179        </row>
1180        <row>
1181         <entry>SCO UnixWare 7</entry>
1182         <entry>x86</entry>
1183         <entry>7.0</entry>
1184         <entry>2000-04-18, Billy G. Allie (<email>Bill.Allie@mug.org</>)</entry>
1185         <entry>See also <filename>doc/FAQ_SCO</></entry>
1186        </row>
1187        <row>
1188         <entry>Solaris</entry>
1189         <entry>x86</entry>
1190         <entry>7.0</entry>
1191         <entry>2000-04-12, Marc Fournier (<email>scrappy@hub.org</>)</entry>
1192         <entry></>
1193        </row>
1194        <row>
1195         <entry>Solaris 2.5.1-2.7</entry>
1196         <entry>Sparc</entry>
1197         <entry>7.0</entry>
1198         <entry>2000-04-12, Peter Eisentraut (<email>peter_e@gmx.net</email>),
1199                            Marc Fournier (<email>scrappy@hub.org</>)</entry>
1200         <entry></>
1201        </row>
1202        <row>
1203         <entry>SunOS 4.1.4</entry>
1204         <entry>Sparc</entry>
1205         <entry>7.0</entry>
1206         <entry>2000-04-13, Tatsuo Ishii (<email>t-ishii@sra.co.jp</>)</entry>
1207         <entry></>
1208        </row>
1209        <row>
1210         <entry>Windows/Win32</entry>
1211         <entry>x86</entry>
1212         <entry>7.0</entry>
1213         <entry>2000-04-02, Magnus Hagander (<email>mha@sollentuna.net</>)</entry>
1214         <entry>Client-side libraries or ODBC/JDBC, no server-side</entry>
1215        </row>
1216        <row>
1217         <entry>WinNT/Cygwin</entry>
1218         <entry>x86</entry>
1219         <entry>7.0</entry>
1220         <entry>2000-03-30, Daniel Horak (<email>horak@sit.plzen-city.cz</>)</entry>
1221         <entry>with RedHat/Cygnus <productname>Cygwin</> toolset</entry>
1222        </row>
1223       </tbody>
1224      </tgroup>
1225     </informaltable>
1226
1227   <formalpara>
1228    <title>Unsupported Platforms</title>
1229    <para>
1230     The following platforms have not been verified to work. Platforms
1231     listed for version 6.3.x and later should also work with
1232     &version;, but we did not receive explicit confirmation of such at
1233     the time this list was compiled. We include these here to let you
1234     know that these platforms <emphasis>could</> be supported if given
1235     some attention.
1236    </para>
1237   </formalpara>
1238
1239   <informaltable>
1240    <tgroup cols="4">
1241     <thead>
1242      <row>
1243       <entry><acronym>OS</acronym></entry>
1244       <entry>Processor</entry>
1245       <entry>Version</entry>
1246       <entry>Reported</entry>
1247       <entry>Remarks</entry>
1248      </row>
1249     </thead>
1250
1251     <tbody>
1252      <row>
1253       <entry>BeOS</entry>
1254       <entry>x86</entry>
1255       <entry>7.0</entry>
1256       <entry>2000-05-01, Adam Haberlach (<email>adam@newsnipple.com</>)</entry>
1257       <entry>Client-side coming soon?</entry>
1258      </row>
1259
1260      <row>
1261       <entry>DGUX 5.4R4.11</entry>
1262       <entry>m88k</entry>
1263       <entry>6.3</entry>
1264       <entry>1998-03-01, Brian E Gallew (<email>geek+@cmu.edu</>)</entry>
1265       <entry>6.4 probably OK. Needs new maintainer.</entry>
1266      </row>
1267
1268      <row>
1269       <entry>NetBSD 1.3</entry>
1270       <entry>VAX</entry>
1271       <entry>6.3</entry>
1272       <entry>1998-03-01, Tom I Helbekkmo (<email>tih@kpnQwest.no</>)</entry>
1273       <entry>7.0 should work.</entry>
1274      </row>
1275
1276      <row>
1277       <entry>System V R4 4.4</entry>
1278       <entry>m88k</entry>
1279       <entry>6.2.1</entry>
1280       <entry>1998-03-01, Doug Winterburn (<email>dlw@seavme.xroads.com</>)</entry>
1281       <entry>Needs new TAS spinlock code</entry>
1282      </row>
1283
1284      <row>
1285       <entry>System V R4</entry>
1286       <entry>MIPS</entry>
1287       <entry>6.4</entry>
1288       <entry>1998-10-28, Frank Ridderbusch (<email>ridderbusch.pad@sni.de</>)</entry>
1289       <entry>No 64-bit integer</entry>
1290      </row>
1291
1292      <row>
1293       <entry>Ultrix</entry>
1294       <entry>MIPS, VAX</entry>
1295       <entry>6.x</entry>
1296       <entry>1998-03-01</entry>
1297       <entry>No recent reports. Obsolete?</entry>
1298      </row>
1299
1300      <row>
1301       <entry>MacOS</entry>
1302       <entry>all</entry>
1303       <entry>6.x</entry>
1304       <entry>1998-03-01</entry>
1305       <entry>Not library compatible; use ODBC/JDBC.</entry>
1306      </row>
1307
1308      <row>
1309       <entry>NextStep</entry>
1310       <entry>x86</entry>
1311       <entry>6.x</entry>
1312       <entry>1998-03-01, David Wetzel (<email>dave@turbocat.de</email>)</entry>
1313       <entry>Client-only support</entry>
1314      </row>
1315     </tbody>
1316    </tgroup>
1317   </informaltable>
1318
1319  </sect1>
1320
1321 </chapter>