]> granicus.if.org Git - postgresql/blob - INSTALL
Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.
[postgresql] / INSTALL
1                       PostgreSQL Installation Instructions
2
3 This document describes the installation of PostgreSQL from the source code
4 distribution.
5
6 -------------------------------------------------------------------------------
7
8 Short Version
9
10   ./configure
11   gmake
12   su
13   gmake install
14   adduser postgres
15   mkdir /usr/local/pgsql/data
16   chown postgres /usr/local/pgsql/data
17   su - postgres
18   /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
19   /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
20   /usr/local/pgsql/bin/createdb test
21   /usr/local/pgsql/bin/psql test
22
23 The long version is the rest of this document.
24
25 -------------------------------------------------------------------------------
26
27 Requirements
28
29 In general, a modern Unix-compatible platform should be able to run PostgreSQL.
30 The platforms that had received specific testing at the time of release are
31 listed in the Section called Supported Platforms below. In the "doc"
32 subdirectory of the distribution there are several platform-specific FAQ
33 documents you might wish to consult if you are having trouble. The following
34 software packages are required for building PostgreSQL:
35
36     * GNU make is required; other make programs will *not* work. GNU make is
37       often installed under the name "gmake"; this document will always refer
38       to it by that name. (On some systems GNU make is the default tool with
39       the name "make".) To test for GNU make enter
40
41         gmake --version
42
43       It is recommended to use version 3.76.1 or later.
44
45     * You need an ISO/ANSI C compiler. Recent versions of GCC are
46       recommendable, but PostgreSQL is known to build with a wide variety of
47       compilers from different vendors.
48
49     * gzip is needed to unpack the distribution in the first place. If you are
50       reading this, you probably already got past that hurdle.
51
52     * The GNU Readline library (for comfortable line editing and command
53       history retrieval) will be used by default. If you don't want to use it
54       then you must specify the "--without-readline" option for "configure".
55       (On NetBSD, the "libedit" library is Readline-compatible and is used if
56       "libreadline" is not found.)
57
58     * To build on Windows NT or Windows 2000 you need the Cygwin and cygipc
59       packages. See the file "doc/FAQ_MSWIN" for details.
60
61 The following packages are optional. They are not required in the default
62 configuration, but they are needed when certain build options are enabled, as
63 explained below.
64
65     * To build the server programming language PL/Perl you need a full Perl
66       installation, including the "libperl" library and the header files. Since
67       PL/Perl will be a shared library, the "libperl" library must be a shared
68       library also on most platforms. This appears to be the default in recent
69       Perl versions, but it was not in earlier versions, and in general it is
70       the choice of whomever installed Perl at your site.
71       If you don't have the shared library but you need one, a message like
72       this will appear during the build to point out this fact:
73
74         *** Cannot build PL/Perl because libperl is not a shared library.
75         *** You might have to rebuild your Perl installation.  Refer to
76         *** the documentation for details.
77
78       (If you don't follow the on-screen output you will merely notice that the
79       PL/Perl library object, "plperl.so" or similar, will not be installed.)
80       If you see this, you will have to rebuild and install Perl manually to be
81       able to build PL/Perl. During the configuration process for Perl, request
82       a shared library.
83
84     * To build the PL/Python server programming language, you need a Python
85       installation, including the header files. Since PL/Python will be a
86       shared library, the "libpython" library must be a shared library also on
87       most platforms. This is not the case in a default Python installation.
88       If after building and installing you have a file called "plpython.so"
89       (possibly a different extension), then everything went well. Otherwise
90       you should have seen a notice like this flying by:
91
92         *** Cannot build PL/Python because libpython is not a shared library.
93         *** You might have to rebuild your Python installation.  Refer to
94         *** the documentation for details.
95
96       That means you have to rebuild (part of) your Python installation to
97       supply this shared library.
98       The catch is that the Python distribution or the Python maintainers do
99       not provide any direct way to do this. The closest thing we can offer you
100       is the information in Python FAQ 3.30. On some operating systems you
101       don't really have to build a shared library, but then you will have to
102       convince the PostgreSQL build system of this. Consult the "Makefile" in
103       the "src/pl/plpython" directory for details.
104
105     * If you want to build Tcl or Tk components (clients and the PL/Tcl
106       language) you of course need a Tcl installation.
107
108     * To build the JDBC driver, you need Ant 1.5 or higher and a JDK. Ant is a
109       special tool for building Java-based packages. It can be downloaded from
110       the Ant web site.
111       If you have several Java compilers installed, it depends on the Ant
112       configuration which one gets used. Precompiled Ant distributions are
113       typically set up to read a file ".antrc" in the current user's home
114       directory for configuration. For example, to use a different JDK than the
115       default, this may work:
116
117         JAVA_HOME=/usr/local/sun-jdk1.3
118         JAVACMD=$JAVA_HOME/bin/java
119
120            Note: Do not try to build the driver by calling "ant" or even
121            "javac" directly. This will not work. Run "gmake" normally as
122            described below.
123
124     * To enable Native Language Support (NLS), that is, the ability to display
125       a program's messages in a language other than English, you need an
126       implementation of the Gettext API. Some operating systems have this
127       built-in (e.g., Linux, NetBSD, Solaris), for other systems you can
128       download an add-on package from here: http://developer.postgresql.org/~petere/
129       bsd-gettext/. If you are using the Gettext implementation in the GNU C
130       library then you will additionally need the GNU Gettext package for some
131       utility programs. For any of the other implementations you will not need
132       it.
133
134     * Kerberos, OpenSSL, or PAM, if you want to support authentication using
135       these services.
136
137 If you are building from a CVS tree instead of using a released source package,
138 or if you want to do development, you also need the following packages:
139
140     * Flex and Bison are needed to build a CVS checkout or if you changed the
141       actual scanner and parser definition files. If you need them, be sure to
142       get Flex 2.5.4 or later and Bison 1.875 or later. Other yacc programs can
143       sometimes be used, but doing so requires extra effort and is not
144       recommended. Other lex programs will definitely not work.
145
146 If you need to get a GNU package, you can find it at your local GNU mirror site
147 (see http://www.gnu.org/order/ftp.html for a list) or at ftp://ftp.gnu.org/
148 gnu/.
149 Also check that you have sufficient disk space. You will need about 65 MB for
150 the source tree during compilation and about 15 MB for the installation
151 directory. An empty database cluster takes about 25 MB, databases take about
152 five times the amount of space that a flat text file with the same data would
153 take. If you are going to run the regression tests you will temporarily need up
154 to an extra 90 MB. Use the "df" command to check for disk space.
155
156 -------------------------------------------------------------------------------
157
158 If You Are Upgrading
159
160 The internal data storage format changes with new releases of PostgreSQL.
161 Therefore, if you are upgrading an existing installation that does not have a
162 version number "7.4.x", you must back up and restore your data as shown here.
163 These instructions assume that your existing installation is under the "/usr/
164 local/pgsql" directory, and that the data area is in "/usr/local/pgsql/data".
165 Substitute your paths appropriately.
166
167    1. Make sure that your database is not updated during or after the backup.
168       This does not affect the integrity of the backup, but the changed data
169       would of course not be included. If necessary, edit the permissions in
170       the file "/usr/local/pgsql/data/pg_hba.conf" (or equivalent) to disallow
171       access from everyone except you.
172
173    2. To back up your database installation, type:
174
175         pg_dumpall > outputfile
176
177       If you need to preserve OIDs (such as when using them as foreign keys),
178       then use the "-o" option when running "pg_dumpall".
179       "pg_dumpall" does not save large objects. Check the documentation if you
180       need to do this.
181       To make the backup, you can use the "pg_dumpall" command from the version
182       you are currently running. For best results, however, try to use the
183       "pg_dumpall" command from PostgreSQL 7.4, since this version contains
184       bug fixes and improvements over older versions. While this advice might
185       seem idiosyncratic since you haven't installed the new version yet, it is
186       advisable to follow it if you plan to install the new version in parallel
187       with the old version. In that case you can complete the installation
188       normally and transfer the data later. This will also decrease the
189       downtime.
190
191    3. If you are installing the new version at the same location as the old one
192       then shut down the old server, at the latest before you install the new
193       files:
194
195         kill -INT `cat /usr/local/pgsql/data/postmaster.pid | sed 1q`
196
197       Versions prior to 7.0 do not have this "postmaster.pid" file. If you are
198       using such a version you must find out the process ID of the server
199       yourself, for example by typing "ps ax | grep postmaster", and supply it
200       to the "kill" command.
201       On systems that have PostgreSQL started at boot time, there is probably a
202       start-up file that will accomplish the same thing. For example, on a Red
203       Hat Linux system one might find that
204
205         /etc/rc.d/init.d/postgresql stop
206
207       works. Another possibility is "pg_ctl stop".
208
209    4. If you are installing in the same place as the old version then it is
210       also a good idea to move the old installation out of the way, in case you
211       have trouble and need to revert to it. Use a command like this:
212
213         mv /usr/local/pgsql /usr/local/pgsql.old
214
215 After you have installed PostgreSQL 7.4, create a new database directory and
216 start the new server. Remember that you must execute these commands while
217 logged in to the special database user account (which you already have if you
218 are upgrading).
219
220   /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
221   /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
222
223 Finally, restore your data with
224
225   /usr/local/pgsql/bin/psql -d template1 -f outputfile
226
227 using the *new* psql.
228 These topics are discussed at length in the documentation, which you are
229 encouraged to read in any case.
230
231 -------------------------------------------------------------------------------
232
233 Installation Procedure
234
235    1. Configuration
236       The first step of the installation procedure is to configure the source
237       tree for your system and choose the options you would like. This is done
238       by running the "configure" script. For a default installation simply
239       enter
240
241         ./configure
242
243       This script will run a number of tests to guess values for various system
244       dependent variables and detect some quirks of your operating system, and
245       finally will create several files in the build tree to record what it
246       found. (You can also run "configure" in a directory outside the source
247       tree if you want to keep the build directory separate.)
248       The default configuration will build the server and utilities, as well as
249       all client applications and interfaces that require only a C compiler.
250       All files will be installed under "/usr/local/pgsql" by default.
251       You can customize the build and installation process by supplying one or
252       more of the following command line options to "configure":
253
254         --prefix=PREFIX
255
256             Install all files under the directory "PREFIX" instead of "/usr/
257             local/pgsql". The actual files will be installed into various
258             subdirectories; no files will ever be installed directly into the
259             "PREFIX" directory.
260             If you have special needs, you can also customize the individual
261             subdirectories with the following options.
262
263         --exec-prefix=EXEC-PREFIX
264
265             You can install architecture-dependent files under a different
266             prefix, "EXEC-PREFIX", than what "PREFIX" was set to. This can be
267             useful to share architecture-independent files between hosts. If
268             you omit this, then "EXEC-PREFIX" is set equal to "PREFIX" and both
269             architecture-dependent and independent files will be installed
270             under the same tree, which is probably what you want.
271
272         --bindir=DIRECTORY
273
274             Specifies the directory for executable programs. The default is
275             "EXEC-PREFIX/bin", which normally means "/usr/local/pgsql/bin".
276
277         --datadir=DIRECTORY
278
279             Sets the directory for read-only data files used by the installed
280             programs. The default is "PREFIX/share". Note that this has nothing
281             to do with where your database files will be placed.
282
283         --sysconfdir=DIRECTORY
284
285             The directory for various configuration files, "PREFIX/etc" by
286             default.
287
288         --libdir=DIRECTORY
289
290             The location to install libraries and dynamically loadable modules.
291             The default is "EXEC-PREFIX/lib".
292
293         --includedir=DIRECTORY
294
295             The directory for installing C and C++ header files. The default is
296             "PREFIX/include".
297
298         --docdir=DIRECTORY
299
300             Documentation files, except "man" pages, will be installed into
301             this directory. The default is "PREFIX/doc".
302
303         --mandir=DIRECTORY
304
305             The man pages that come with PostgreSQL will be installed under
306             this directory, in their respective "manx" subdirectories. The
307             default is "PREFIX/man".
308
309            Note: Care has been taken to make it possible to install
310            PostgreSQL into shared installation locations (such as "/usr/
311            local/include") without interfering with the namespace of the
312            rest of the system. First, the string "/postgresql" is
313            automatically appended to datadir, sysconfdir, and docdir,
314            unless the fully expanded directory name already contains the
315            string "postgres" or "pgsql". For example, if you choose "/usr/
316            local" as prefix, the documentation will be installed in "/usr/
317            local/doc/postgresql", but if the prefix is "/opt/postgres",
318            then it will be in "/opt/postgres/doc". The public C header
319            files of the client interfaces are installed into includedir
320            and are namespace-clean. The internal header files and the
321            server header files are installed into private directories
322            under includedir. See the documentation of each interface for
323            information about how to get at the its header files. Finally,
324            a private subdirectory will also be created, if appropriate,
325            under libdir for dynamically loadable modules.
326
327         --with-includes=DIRECTORIES
328
329             "DIRECTORIES" is a colon-separated list of directories that will be
330             added to the list the compiler searches for header files. If you
331             have optional packages (such as GNU Readline) installed in a non-
332             standard location, you have to use this option and probably also
333             the corresponding "--with-libraries" option.
334             Example: --with-includes=/opt/gnu/include:/usr/sup/include.
335
336         --with-libraries=DIRECTORIES
337
338             "DIRECTORIES" is a colon-separated list of directories to search
339             for libraries. You will probably have to use this option (and the
340             corresponding "--with-includes" option) if you have packages
341             installed in non-standard locations.
342             Example: --with-libraries=/opt/gnu/lib:/usr/sup/lib.
343
344         --enable-nls[=LANGUAGES]
345
346             Enables Native Language Support (NLS), that is, the ability to
347             display a program's messages in a language other than English.
348             "LANGUAGES" is a space separated list of codes of the languages
349             that you want supported, for example --enable-nls='de fr'. (The
350             intersection between your list and the set of actually provided
351             translations will be computed automatically.) If you do not specify
352             a list, then all available translations are installed.
353             To use this option, you will need an implementation of the Gettext
354             API; see above.
355
356         --with-pgport=NUMBER
357
358             Set "NUMBER" as the default port number for server and clients. The
359             default is 5432. The port can always be changed later on, but if
360             you specify it here then both server and clients will have the same
361             default compiled in, which can be very convenient. Usually the only
362             good reason to select a non-default value is if you intend to run
363             multiple PostgreSQL servers on the same machine.
364
365         --with-perl
366
367             Build the PL/Perl server-side language.
368
369         --with-python
370
371             Build the PL/Python server-side language.
372
373         --with-tcl
374
375             Build components that require Tcl/Tk, which are libpgtcl, pgtclsh,
376             pgtksh, and PL/Tcl. But see below about "--without-tk".
377
378         --without-tk
379
380             If you specify "--with-tcl" and this option, then the program that
381             requires Tk (pgtksh) will be excluded.
382
383         --with-tclconfig=DIRECTORY, --with-tkconfig=DIRECTORY
384
385             Tcl/Tk installs the files "tclConfig.sh" and "tkConfig.sh", which
386             contain configuration information needed to build modules
387             interfacing to Tcl or Tk. These files are normally found
388             automatically at their well-known locations, but if you want to use
389             a different version of Tcl or Tk you can specify the directory in
390             which to find them.
391
392         --with-java
393
394             Build the JDBC driver and associated Java packages.
395
396         --with-krb4[=DIRECTORY], --with-krb5[=DIRECTORY]
397
398             Build with support for Kerberos authentication. You can use either
399             Kerberos version 4 or 5, but not both. The "DIRECTORY" argument
400             specifies the root directory of the Kerberos installation; "/usr/
401             athena" is assumed as default. If the relevant header files and
402             libraries are not under a common parent directory, then you must
403             use the "--with-includes" and "--with-libraries" options in
404             addition to this option. If, on the other hand, the required files
405             are in a location that is searched by default (e.g., "/usr/lib"),
406             then you can leave off the argument.
407             "configure" will check for the required header files and libraries
408             to make sure that your Kerberos installation is sufficient before
409             proceeding.
410
411         --with-krb-srvnam=NAME
412
413             The name of the Kerberos service principal. postgres is the
414             default. There's probably no reason to change this.
415
416         --with-openssl[=DIRECTORY]
417
418             Build with support for SSL (encrypted) connections. This requires
419             the OpenSSL package to be installed. The "DIRECTORY" argument
420             specifies the root directory of the OpenSSL installation; the
421             default is "/usr/local/ssl".
422             "configure" will check for the required header files and libraries
423             to make sure that your OpenSSL installation is sufficient before
424             proceeding.
425
426         --with-pam
427
428             Build with PAM (Pluggable Authentication Modules) support.
429
430         --without-readline
431
432             Prevents the use of the Readline library. This disables command-
433             line editing and history in psql, so it is not recommended.
434
435         --with-rendezvous
436
437             Build with Rendezvous support.
438
439         --disable-spinlocks
440
441             Allow the builds to succeed even if PostgreSQL has no CPU spinlock
442             support for the platform. The lack of spinlock support will result
443             in poor performance; therefore, this option should only be used if
444             the build aborts and informs you that the platform lacks spinlock
445             support.
446
447         --enable-thread-safety
448
449             Make the client libraries thread-safe. This allows concurrent
450             threads in libpq and ECPG programs to safely control their private
451             connection handles.
452
453         --without-zlib
454
455             Prevents the use of the Zlib library. This disables compression
456             support in pg_dump. This option is only intended for those rare
457             systems where this library is not available.
458
459         --enable-debug
460
461             Compiles all programs and libraries with debugging symbols. This
462             means that you can run the programs through a debugger to analyze
463             problems. This enlarges the size of the installed executables
464             considerably, and on non-GCC compilers it usually also disables
465             compiler optimization, causing slowdowns. However, having the
466             symbols available is extremely helpful for dealing with any
467             problems that may arise. Currently, this option is recommended for
468             production installations only if you use GCC. But you should always
469             have it on if you are doing development work or running a beta
470             version.
471
472         --enable-cassert
473
474             Enables assertion checks in the server, which test for many "can't
475             happen" conditions. This is invaluable for code development
476             purposes, but the tests slow things down a little. Also, having the
477             tests turned on won't necessarily enhance the stability of your
478             server! The assertion checks are not categorized for severity, and
479             so what might be a relatively harmless bug will still lead to
480             server restarts if it triggers an assertion failure. Currently,
481             this option is not recommended for production use, but you should
482             have it on for development work or when running a beta version.
483
484         --enable-depend
485
486             Enables automatic dependency tracking. With this option, the
487             makefiles are set up so that all affected object files will be
488             rebuilt when any header file is changed. This is useful if you are
489             doing development work, but is just wasted overhead if you intend
490             only to compile once and install. At present, this option will work
491             only if you use GCC.
492
493       If you prefer a C compiler different from the one "configure" picks then
494       you can set the environment variable CC to the program of your choice. By
495       default, "configure" will pick "gcc" unless this is inappropriate for the
496       platform. Similarly, you can override the default compiler flags with the
497       CFLAGS variable.
498
499       You can specify environment variables on the "configure" command line,
500       for example:
501
502         ./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'
503
504    2. Build
505       To start the build, type
506
507         gmake
508
509       (Remember to use GNU make.) The build may take anywhere from 5 minutes to
510       half an hour depending on your hardware. The last line displayed should
511       be
512
513         All of PostgreSQL is successfully made. Ready to install.
514
515    3. Regression Tests
516       If you want to test the newly built server before you install it, you can
517       run the regression tests at this point. The regression tests are a test
518       suite to verify that PostgreSQL runs on your machine in the way the
519       developers expected it to. Type
520
521         gmake check
522
523       (This won't work as root; do it as an unprivileged user.) The file "src/
524       test/regress/README" and the documentation contain detailed information
525       about interpreting the test results. You can repeat this test at any
526       later time by issuing the same command.
527
528    4. Installing The Files
529            Note: If you are upgrading an existing system and are going to
530            install the new files over the old ones, then you should have
531            backed up your data and shut down the old server by now, as
532            explained in
533            the Section called If You Are Upgrading
534             above.
535       To install PostgreSQL enter
536
537         gmake install
538
539       This will install files into the directories that were specified in step
540       1. Make sure that you have appropriate permissions to write into that
541       area. Normally you need to do this step as root. Alternatively, you could
542       create the target directories in advance and arrange for appropriate
543       permissions to be granted.
544       You can use gmake install-strip instead of gmake install to strip the
545       executable files and libraries as they are installed. This will save some
546       space. If you built with debugging support, stripping will effectively
547       remove the debugging support, so it should only be done if debugging is
548       no longer needed. install-strip tries to do a reasonable job saving
549       space, but it does not have perfect knowledge of how to strip every
550       unneeded byte from an executable file, so if you want to save all the
551       disk space you possibly can, you will have to do manual work.
552       The standard installation provides only the header files needed for
553       client application development. If you plan to do any server-side program
554       development (such as custom functions or data types written in C), then
555       you may want to install the entire PostgreSQL include tree into your
556       target include directory. To do that, enter
557
558         gmake install-all-headers
559
560       This adds a megabyte or two to the installation footprint, and is only
561       useful if you don't plan to keep the whole source tree around for
562       reference. (If you do, you can just use the source's include directory
563       when building server-side software.)
564       Client-only installation: If you want to install only the client
565       applications and interface libraries, then you can use these commands:
566
567         gmake -C src/bin install
568         gmake -C src/include install
569         gmake -C src/interfaces install
570         gmake -C doc install
571
572 Uninstallation: To undo the installation use the command "gmake uninstall".
573 However, this will not remove any created directories.
574 Cleaning: After the installation you can make room by removing the built files
575 from the source tree with the command "gmake clean". This will preserve the
576 files made by the "configure" program, so that you can rebuild everything with
577 "gmake" later on. To reset the source tree to the state in which it was
578 distributed, use "gmake distclean". If you are going to build for several
579 platforms from the same source tree you must do this and re-configure for each
580 build.
581 If you perform a build and then discover that your "configure" options were
582 wrong, or if you change anything that "configure" investigates (for example,
583 software upgrades), then it's a good idea to do "gmake distclean" before
584 reconfiguring and rebuilding. Without this, your changes in configuration
585 choices may not propagate everywhere they need to.
586
587 -------------------------------------------------------------------------------
588
589 Post-Installation Setup
590
591 Shared Libraries
592
593 On some systems that have shared libraries (which most systems do) you need to
594 tell your system how to find the newly installed shared libraries. The systems
595 on which this is *not* necessary include BSD/OS, FreeBSD, HP-UX, IRIX, Linux,
596 NetBSD, OpenBSD, Tru64 UNIX (formerly Digital UNIX), and Solaris.
597 The method to set the shared library search path varies between platforms, but
598 the most widely usable method is to set the environment variable
599 LD_LIBRARY_PATH like so: In Bourne shells ("sh", "ksh", "bash", "zsh")
600
601   LD_LIBRARY_PATH=/usr/local/pgsql/lib
602   export LD_LIBRARY_PATH
603
604 or in "csh" or "tcsh"
605
606   setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
607
608 Replace /usr/local/pgsql/lib with whatever you set "--libdir" to in step 1. You
609 should put these commands into a shell start-up file such as "/etc/profile" or
610 "~/.bash_profile". Some good information about the caveats associated with this
611 method can be found at http://www.visi.com/~barr/ldpath.html.
612 On some systems it might be preferable to set the environment variable
613 LD_RUN_PATH *before* building.
614 On Cygwin, put the library directory in the PATH or move the ".dll" files into
615 the "bin" directory.
616 If in doubt, refer to the manual pages of your system (perhaps "ld.so" or
617 "rld"). If you later on get a message like
618
619   psql: error in loading shared libraries
620   libpq.so.2.1: cannot open shared object file: No such file or directory
621
622 then this step was necessary. Simply take care of it then.
623 If you are on BSD/OS, Linux, or SunOS 4 and you have root access you can run
624
625   /sbin/ldconfig /usr/local/pgsql/lib
626
627 (or equivalent directory) after installation to enable the run-time linker to
628 find the shared libraries faster. Refer to the manual page of "ldconfig" for
629 more information. On FreeBSD, NetBSD, and OpenBSD the command is
630
631   /sbin/ldconfig -m /usr/local/pgsql/lib
632
633 instead. Other systems are not known to have an equivalent command.
634
635 -------------------------------------------------------------------------------
636
637 Environment Variables
638
639 If you installed into "/usr/local/pgsql" or some other location that is not
640 searched for programs by default, you should add "/usr/local/pgsql/bin" (or
641 whatever you set "--bindir" to in step 1) into your PATH. Strictly speaking,
642 this is not necessary, but it will make the use of PostgreSQL much more
643 convenient.
644 To do this, add the following to your shell start-up file, such as
645 "~/.bash_profile" (or "/etc/profile", if you want it to affect every user):
646
647   PATH=/usr/local/pgsql/bin:$PATH
648   export PATH
649
650 If you are using "csh" or "tcsh", then use this command:
651
652   set path = ( /usr/local/pgsql/bin $path )
653
654 To enable your system to find the man documentation, you need to add lines like
655 the following to a shell start-up file unless you installed into a location
656 that is searched by default.
657
658   MANPATH=/usr/local/pgsql/man:$MANPATH
659   export MANPATH
660
661 The environment variables PGHOST and PGPORT specify to client applications the
662 host and port of the database server, overriding the compiled-in defaults. If
663 you are going to run client applications remotely then it is convenient if
664 every user that plans to use the database sets PGHOST. This is not required,
665 however: the settings can be communicated via command line options to most
666 client programs.
667
668 -------------------------------------------------------------------------------
669
670 Getting Started
671
672 The following is a quick summary of how to get PostgreSQL up and running once
673 installed. The main documentation contains more information.
674
675    1. Create a user account for the PostgreSQL server. This is the user the
676       server will run as. For production use you should create a separate,
677       unprivileged account ("postgres" is commonly used). If you do not have
678       root access or just want to play around, your own user account is enough,
679       but running the server as root is a security risk and will not work.
680
681         adduser postgres
682
683    2. Create a database installation with the "initdb" command. To run "initdb"
684       you must be logged in to your PostgreSQL server account. It will not work
685       as root.
686
687         root# mkdir /usr/local/pgsql/data
688         root# chown postgres /usr/local/pgsql/data
689         root# su - postgres
690         postgres$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
691
692       The "-D" option specifies the location where the data will be stored. You
693       can use any path you want, it does not have to be under the installation
694       directory. Just make sure that the server account can write to the
695       directory (or create it, if it doesn't already exist) before starting
696       "initdb", as illustrated here.
697
698    3. The previous step should have told you how to start up the database
699       server. Do so now. The command should look something like
700
701         /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
702
703       This will start the server in the foreground. To put the server in the
704       background use something like
705
706         nohup /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data \
707             </dev/null >>server.log 2>&1 </dev/null &
708
709       To stop a server running in the background you can type
710
711         kill `cat /usr/local/pgsql/data/postmaster.pid`
712
713       In order to allow TCP/IP connections (rather than only Unix domain socket
714       ones) you need to pass the "-i" option to "postmaster".
715
716    4. Create a database:
717
718         createdb testdb
719
720       Then enter
721
722         psql testdb
723
724       to connect to that database. At the prompt you can enter SQL commands and
725       start experimenting.
726
727 -------------------------------------------------------------------------------
728
729 What Now?
730
731     * The PostgreSQL distribution contains a comprehensive documentation set,
732       which you should read sometime. After installation, the documentation can
733       be accessed by pointing your browser to "/usr/local/pgsql/doc/html/
734       index.html", unless you changed the installation directories.
735       The first few chapters of the main documentation are the Tutorial, which
736       should be your first reading if you are completely new to SQL databases.
737       If you are familiar with database concepts then you want to proceed with
738       part on server administration, which contains information about how to
739       set up the database server, database users, and authentication.
740
741     * Usually, you will want to modify your computer so that it will
742       automatically start the database server whenever it boots. Some
743       suggestions for this are in the documentation.
744
745     * Run the regression tests against the installed server (using "gmake
746       installcheck"). If you didn't run the tests before installation, you
747       should definitely do it now. This is also explained in the documentation.
748
749     * By default, PostgreSQL is configured to run on minimal hardware. This
750       allows it to start up with almost any hardware configuration. The default
751       configuration is, however, not designed for optimum performance. To
752       achieve optimum performance, several server parameters must be adjusted,
753       the two most common being shared_buffers and sort_mem mentioned in the
754       documentation. Other parameters mentioned in the documentation also
755       affect performance.
756
757 -------------------------------------------------------------------------------
758
759 Supported Platforms
760
761 PostgreSQL has been verified by the developer community to work on the
762 platforms listed below. A supported platform generally means that PostgreSQL
763 builds and installs according to these instructions and that the regression
764 tests pass.
765      Note: If you are having problems with the installation on a supported
766      platform, please write to <pgsql-bugs@postgresql.org> or <pgsql-
767      ports@postgresql.org>, not to the people listed here.
768  _____________________________________________________________________________
769 |OS__________|Processor|Version|Reported______________________|Remarks________|
770 |AIX         |RS6000   |7.4    |2003-10-25, Hans-Jürgen       |see also doc/  |
771 |____________|_________|_______|Schönig_(<hs@cybertec.at>)____|FAQ_AIX________|
772 |BSD/OS      |x86      |7.4    |2003-10-24, Bruce Momjian     |4.3            |
773 |____________|_________|_______|(<pgman@candle.pha.pa.us>)____|_______________|
774 |FreeBSD     |Alpha    |7.4    |2003-10-25, Peter Eisentraut  |4.8            |
775 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
776 |FreeBSD     |x86      |7.4    |2003-10-24, Peter Eisentraut  |4.9            |
777 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
778 |HP-UX       |PA-RISC  |7.4    |2003-10-31, 10.20, Tom Lane   |gcc and cc; see|
779 |            |         |       |(<tgl@sss.pgh.pa.us>); 2003-  |also doc/      |
780 |            |         |       |11-04, 11.00, Peter Eisentraut|FAQ_HPUX       |
781 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
782 |IRIX        |MIPS     |7.4    |2003-11-12, Robert E.         |6.5.20, cc only|
783 |            |         |       |Bruccoleri                    |               |
784 |____________|_________|_______|(<bruc@stone.congenomics.com>)|_______________|
785 |Linux       |Alpha    |7.4    |2003-10-25, Noèl Köthe        |2.4            |
786 |____________|_________|_______|(<noel@debian.org>)___________|_______________|
787 |Linux       |arm41    |7.4    |2003-10-25, Noèl Köthe        |2.4            |
788 |____________|_________|_______|(<noel@debian.org>)___________|_______________|
789 |Linux       |Itanium  |7.4    |2003-10-25, Noèl Köthe        |2.4            |
790 |____________|_________|_______|(<noel@debian.org>)___________|_______________|
791 |Linux       |m68k     |7.4    |2003-10-25, Noèl Köthe        |2.4            |
792 |____________|_________|_______|(<noel@debian.org>)___________|_______________|
793 |Linux       |MIPS     |7.4    |2003-10-25, Noèl Köthe        |2.4            |
794 |____________|_________|_______|(<noel@debian.org>)___________|_______________|
795 |Linux       |Opteron  |7.4    |2003-11-01, Jani Averbach     |2.6            |
796 |____________|_________|_______|(<jaa@cc.jyu.fi>)_____________|_______________|
797 |Linux       |PPC      |7.4    |2003-10-25, Noèl Köthe        |               |
798 |____________|_________|_______|(<noel@debian.org>)___________|_______________|
799 |Linux       |S/390    |7.4    |2003-10-25, Noèl Köthe        |2.4            |
800 |____________|_________|_______|(<noel@debian.org>)___________|_______________|
801 |Linux       |Sparc    |7.4    |2003-10-24, Peter Eisentraut  |2.4, 32-bit    |
802 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
803 |Linux       |x86      |7.4    |2003-10-24, Peter Eisentraut  |2.4            |
804 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
805 |MacOS X     |PPC      |7.4    |2003-10-24, 10.2.8, Adam      |               |
806 |            |         |       |Witney                        |               |
807 |            |         |       |(<awitney@sghms.ac.uk>), 10.3,|               |
808 |            |         |       |Marko Karppinen               |               |
809 |____________|_________|_______|(<marko@karppinen.fi>)________|_______________|
810 |NetBSD      |arm32    |7.4    |2003-11-12, Patrick Welche    |1.6ZE/acorn32  |
811 |____________|_________|_______|(<prlw1@newn.cam.ac.uk>)______|_______________|
812 |NetBSD      |x86      |7.4    |2003-10-24, Peter Eisentraut  |1.6            |
813 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
814 |OpenBSD     |Sparc    |7.4    |2003-11-01, Peter Eisentraut  |3.4            |
815 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
816 |OpenBSD     |x86      |7.4    |2003-10-24, Peter Eisentraut  |3.2            |
817 |____________|_________|_______|(<peter_e@gmx.net>)___________|_______________|
818 |Solaris     |Sparc    |7.4    |2003-10-26, Christopher Browne|2.8; see also  |
819 |____________|_________|_______|(<cbbrowne@libertyrms.info>)__|doc/FAQ_Solaris|
820 |Solaris     |x86      |7.4    |2003-10-26, Kurt Roeckx       |2.6 see also   |
821 |____________|_________|_______|(<Q@ping.be>)_________________|doc/FAQ_Solaris|
822 |Tru64 UNIX  |Alpha    |7.4    |2003-10-25, 5.1b, Peter       |               |
823 |            |         |       |Eisentraut                    |               |
824 |            |         |       |(<peter_e@gmx.net>); 2003-10- |               |
825 |            |         |       |29, 4.0g, Alessio Bragadini   |               |
826 |____________|_________|_______|(<alessio@albourne.com>)______|_______________|
827 |UnixWare    |x86      |7.4    |2003-11-03, Larry Rosenman    |7.1.3; join    |
828 |            |         |       |(<ler@lerctr.org>)            |test may fail, |
829 |            |         |       |                              |see also doc/  |
830 |____________|_________|_______|______________________________|FAQ_SCO________|
831 |Windows with|x86      |7.4    |2003-10-24, Peter Eisentraut  |see doc/       |
832 |Cygwin______|_________|_______|(<peter_e@gmx.net>)___________|FAQ_MSWIN______|
833 |Windows     |x86      |7.4    |2003-10-27, Dave Page         |native is      |
834 |            |         |       |(<dpage@vale-housing.co.uk>)  |client-side    |
835 |            |         |       |                              |only, see      |
836 |____________|_________|_______|______________________________|documentation__|
837
838 Unsupported Platforms: The following platforms are either known not to work, or
839 they used to work in a previous release and we did not receive explicit
840 confirmation of a successful test with version 7.4 at the time this list was
841 compiled. We include these here to let you know that these platforms *could* be
842 supported if given some attention.
843  ________________________________________________________________________________
844 |OS________|Processor__|Version|Reported_______________________|Remarks__________|
845 |BeOS      |x86        |7.2    |2001-11-29, Cyril Velter       |needs updates to |
846 |__________|___________|_______|(<cyril.velter@libertysurf.fr>)|semaphore_code___|
847 |Linux     |PlayStation|7.4    |2003-11-02, Peter Eisentraut   |needs new        |
848 |          |2          |       |(<peter_e@gmx.net>)            |config.guess, -- |
849 |          |           |       |                               |disable-         |
850 |          |           |       |                               |spinlocks, #undef|
851 |          |           |       |                               |HAS_TEST_AND_SET,|
852 |          |           |       |                               |disable tas_dummy|
853 |__________|___________|_______|_______________________________|()_______________|
854 |Linux     |PA-RISC    |7.4    |2003-10-25, Noèl Köthe         |needs --disable- |
855 |          |           |       |(<noel@debian.org>)            |spinlocks,       |
856 |__________|___________|_______|_______________________________|otherwise_OK_____|
857 |NetBSD    |Alpha      |7.2    |2001-11-20, Thomas Thai        |1.5W             |
858 |__________|___________|_______|(<tom@minnesota.com>)__________|_________________|
859 |NetBSD    |MIPS       |7.2.1  |2002-06-13, Warwick Hunter     |1.5.3            |
860 |__________|___________|_______|(<whunter@agile.tv>)___________|_________________|
861 |NetBSD    |PPC        |7.2    |2001-11-28, Bill Studenmund    |1.5              |
862 |__________|___________|_______|(<wrstuden@netbsd.org>)________|_________________|
863 |NetBSD    |Sparc      |7.2    |2001-12-03, Matthew Green      |32- and 64-bit   |
864 |__________|___________|_______|(<mrg@eterna.com.au>)__________|builds___________|
865 |NetBSD    |VAX        |7.1    |2001-03-30, Tom I. Helbekkmo   |1.5              |
866 |__________|___________|_______|(<tih@kpnQwest.no>)____________|_________________|
867 |QNX 4 RTOS|x86        |7.2    |2001-12-10, Bernd Tegge        |needs updates to |
868 |          |           |       |(<tegge@repas-aeg.de>)         |semaphore code;  |
869 |          |           |       |                               |see also doc/    |
870 |__________|___________|_______|_______________________________|FAQ_QNX4_________|
871 |QNX RTOS  |x86        |7.2    |2001-11-20, Igor Kovalenko     |patches available|
872 |v6        |           |       |(<Igor.Kovalenko@motorola.com>)|in archives, but |
873 |__________|___________|_______|_______________________________|too_late_for_7.2_|
874 |SCO       |x86        |7.3.1  |2002-12-11, Shibashish Satpathy|5.0.4, gcc; see  |
875 |OpenServer|___________|_______|(<shib@postmark.net>)__________|also_doc/FAQ_SCO_|
876 |SunOS 4   |Sparc      |7.2    |2001-12-04, Tatsuo Ishii (<t-  |                 |
877 |__________|___________|_______|ishii@sra.co.jp>)______________|_________________|