From a7b8de40db31c935e5d89cd2141b1f346582c9c6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 26 Mar 2000 07:03:38 +0000 Subject: [PATCH] Rearrange steps in recommended install procedure to something more reasonable, ie configure and build first, then optionally run regress tests using new parallel (non-installed) test method, and only then backup and kill old installation. --- doc/src/sgml/install.sgml | 264 ++++++++++++++++++++++++++-------------------- 1 file changed, 148 insertions(+), 116 deletions(-) diff --git a/doc/src/sgml/install.sgml b/doc/src/sgml/install.sgml index 98147f425b..6d3fe63fd0 100644 --- a/doc/src/sgml/install.sgml +++ b/doc/src/sgml/install.sgml @@ -96,8 +96,9 @@ your own user account is enough. Running PostgreSQL as root, bin, -or any other account with special access rights is a security risk and therefore -won't be allowed. +or any other account with special access rights is a security risk; +don't do it. The postmaster will in fact refuse +to start as root. You need not do the building and installation itself under this account @@ -108,99 +109,6 @@ database superuser. -If you are not upgrading an existing system then skip to -. - - - -You now need to back up your existing database. -To dump your fairly recent post-6.0 database installation, type - -pg_dumpall > db.out - -If you wish to preserve object id's (oids), then use the -o -option when running pg_dumpall. -However, unless you have a -special reason for doing this (such as using OIDs as keys -in tables), don't do it. - - - -Make sure to use the pg_dumpall -command from the version you are currently running. -However, do not use the pg_dumpall -script from 6.0 or everything will be owned by the -PostgreSQL super user. In that case -you should grab pg_dumpall from a later -6.x.x release. 7.0's pg_dumpall -will not work on older databases. -If you are upgrading from a version prior to -Postgres95 v1.09 then you must back up your database, -install Postgres95 v1.09, restore your database, -then back it up again. - - - - - You must make sure that your database is not updated in the middle of - your backup. If necessary, bring down postmaster, edit the permissions - in file /usr/local/pgsql/data/pg_hba.conf - to allow only you on, then - bring postmaster back up. - - - - - - -If you are upgrading an existing system then kill the database server now. Type - -ps ax | grep postmaster - -or - -ps -e | grep postmaster - -(It depends on your system which one of these two works. No harm can be done -by typing the wrong one.) -This should list the process numbers for a number of processes, similar -to this: - - 263 ? SW 0:00 (postmaster) - 777 p1 S 0:00 grep postmaster - -Type the following line, with pid -replaced by the process id for process postmaster -(263 in the above case). (Do not use the id for the process "grep postmaster".) - -kill pid - - - - - -On systems which have PostgreSQL started at boot time, there -is probably a startup file which will accomplish the same thing. For example, on a -Redhat Linux system one might find that - -/etc/rc.d/init.d/postgres.init stop - -works. - - - - -Also move the old directories out of the way. Type the following: - -mv /usr/local/pgsql /usr/local/pgsql.old - -or replace your particular paths. - - - - - - Configure the source code for your system. It is this step at which you can specify your actual installation path for the build process and make choices about what gets installed. Change into the src @@ -249,10 +157,14 @@ For a complete list of options, type: --with-perl - Builds the Perl interface. Please note that the Perl interface will be + Builds the Perl interface and plperl extension language. + Please note that the Perl interface needs to be installed into the usual place for Perl modules (typically under - /usr/lib/perl), so you must have root access to use - this option successfully. + /usr/lib/perl), so you must have root access + to perform the installation step. (It is often easiest to leave out + --with-perl initially, and then build and install the + Perl interface after completing the installation of PostgreSQL + itself.) @@ -287,7 +199,7 @@ Compile the program. Type gmake The compilation process can take anywhere from 10 minutes to an hour. -Your milage will most certainly vary. Remember to use GNU make. +Your mileage will most certainly vary. Remember to use GNU make. @@ -298,19 +210,132 @@ All of PostgreSQL is successfully made. Ready to install. + + +If you want to test the newly built server before you install it, +you can run the regression tests at this point. The regression tests +are a test suite to verify that PostgreSQL +runs on your machine in the way the developers expected it to. +For detailed instructions see . +(Be sure to use the "parallel regress test" method, since the sequential +method only works with an already-installed server.) + + + -Install the program. Type +If you are not upgrading an existing system then skip to +. + + + +You now need to back up your existing database. +To dump your fairly recent post-6.0 database installation, type + +pg_dumpall > db.out + +If you wish to preserve object id's (oids), then use the -o +option when running pg_dumpall. +However, unless you have a +special reason for doing this (such as using OIDs as keys +in tables), don't do it. + + + +Make sure to use the pg_dumpall +command from the version you are currently running. +7.0's pg_dumpall will not work on older databases. +However, if you are still using 6.0, do not use the +pg_dumpall script from 6.0 or everything will be +owned by the PostgreSQL superuser after you +reload. In that case +you should grab pg_dumpall from a later +6.x.x release. +If you are upgrading from a version prior to +Postgres95 v1.09 then you must back up your database, +install Postgres95 v1.09, restore your database, +then back it up again. + + + + + You must make sure that your database is not updated in the middle of + your backup. If necessary, bring down postmaster, edit the permissions + in file /usr/local/pgsql/data/pg_hba.conf + to allow only you on, then + bring postmaster back up. + + + + + + +If you are upgrading an existing system then kill the database server now. Type + +ps ax | grep postmaster + +or + +ps -e | grep postmaster + +(It depends on your system which one of these two works. No harm can be done +by typing the wrong one.) +This should list the process numbers for a number of processes, similar +to this: + + 263 ? SW 0:00 (postmaster) + 777 p1 S 0:00 grep postmaster + +Type the following line, with pid +replaced by the process id for process postmaster +(263 in the above case). (Do not use the id for the process "grep postmaster".) + +kill pid + + + + + +On systems which have PostgreSQL started at boot time, there +is probably a startup file which will accomplish the same thing. For example, on a +Redhat Linux system one might find that + +/etc/rc.d/init.d/postgres.init stop + +works. + + + + +Also move the old directories out of the way. Type the following: + +mv /usr/local/pgsql /usr/local/pgsql.old + +(substitute your particular paths). + + + + + + +Install the PostgreSQL executable files and +libraries. Type gmake install + +You should do this step as the user that you want the installed executables +to be owned by. This does not have to be the same as the database superuser; +some people prefer to have the installed files be owned by root. + -Tell your system how to find the new shared libraries. How to do this varies between -platforms. What tends to work everywhere is to set the environment variable +If necessary, tell your system how to find the new shared libraries. +How to do this varies between platforms. The most widely usable method +is to set the environment variable LD_LIBRARY_PATH: LD_LIBRARY_PATH=/usr/local/pgsql/lib @@ -347,7 +372,8 @@ then the above was necessary. Simply do this step then. -Create the database installation. To do this you must log in to your +Create the database installation (the working data files). +To do this you must log in to your PostgreSQL superuser account. It will not work as root. @@ -361,21 +387,29 @@ su - postgres The option specifies the location where the data will be stored. You can use any path you want, it does not have to be under the installation directory. Just make sure that the superuser account -can write to the directory (or create it) before starting initdb. +can write to the directory (or create it, if it doesn't already exist) +before starting initdb. (If you have already been doing the installation up to now as the PostgreSQL -superuser, you may have to log in as root temporarily to create the data directory.) +superuser, you may have to log in as root temporarily to create the data +directory underneath a root-owned directory.) The previous step should have told you how to start up the database server. -Do so now. +Do so now. The command should look something like /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data This will start the server in the foreground. To make it detach to -the background, use the . +the background, you can use the option, but then you won't +see any log messages the server produces. A better way to put the server +in the background is + +nohup /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data \ + </dev/null >>server.log 2>>1 & + @@ -400,7 +434,7 @@ you should look at the following optional steps and suggestions. -Life will be more convenient if you set up some enviroment variables. First of all +Life will be more convenient if you set up some environment variables. First of all you probably want to include /usr/local/pgsql/bin (or equivalent) into your PATH. To do this, add the following to your shell startup file, such as ~/.bash_profile (or /etc/profile, @@ -537,12 +571,10 @@ Then make a softlink to this file from -Run the regression tests. The regression tests are a test suite to verify that -PostgreSQL runs on your machine in the way the developers expected it to. -You should definitely do this before putting a server into production use. -The file /usr/src/pgsql/postgresql-7.0/src/test/regress/README -has detailed -instructions for running and interpreting the regression tests. +Run the regression tests against the installed server (using the sequential +test method). If you didn't run the tests before installation, you should +definitely do it now. +For detailed instructions see . @@ -558,8 +590,8 @@ Then enter psql testdb -to connect to that database. At the prompt you can enter SQL and start -experimenting. +to connect to that database. At the prompt you can enter SQL commands +and start experimenting. -- 2.11.0