|
|
|
@ -8,24 +8,15 @@ |
|
|
|
|
</Para> |
|
|
|
|
</Abstract> |
|
|
|
|
|
|
|
|
|
<Para> |
|
|
|
|
Commands were tested on RedHat Linux version 5.2 using the bash shell. |
|
|
|
|
Except where noted, they will probably work on most systems. Commands |
|
|
|
|
like <command>ps</command> and <command>tar</command> may vary wildly |
|
|
|
|
between platforms on what options you should use. |
|
|
|
|
<Emphasis>Use common sense</Emphasis> before typing in these commands. |
|
|
|
|
</Para> |
|
|
|
|
|
|
|
|
|
<Para> |
|
|
|
|
If you haven't gotten the <ProductName>PostgreSQL</ProductName> distribution, |
|
|
|
|
get it from <ULink url="ftp://ftp.postgresql.org">ftp.postgresql.org</ULink>, |
|
|
|
|
then unpack it: |
|
|
|
|
<ProgramListing> |
|
|
|
|
$ gunzip postgresql-7.0.tar.gz |
|
|
|
|
$ tar -xf postgresql-7.0.tar |
|
|
|
|
$ mv postgresql-7.0 /usr/src |
|
|
|
|
gunzip postgresql-7.0.tar.gz |
|
|
|
|
tar -xf postgresql-7.0.tar |
|
|
|
|
mv postgresql-7.0 /usr/src |
|
|
|
|
</ProgramListing> |
|
|
|
|
Again, these commands might differ on your system. |
|
|
|
|
</Para> |
|
|
|
|
|
|
|
|
|
<Sect1> |
|
|
|
@ -41,7 +32,7 @@ $ mv postgresql-7.0 /usr/src |
|
|
|
|
<Application>make</Application>, no matter what name it has on your system. |
|
|
|
|
To test for <acronym>GNU</acronym> <Application>make</Application> enter |
|
|
|
|
<programlisting> |
|
|
|
|
$ <userinput>gmake --version</userinput> |
|
|
|
|
<userinput>gmake --version</userinput> |
|
|
|
|
</programlisting> |
|
|
|
|
If you need to get <acronym>GNU</acronym> <Application>make</Application>, you can |
|
|
|
|
find it at <ULink url="ftp://ftp.gnu.org">ftp://ftp.gnu.org</ULink>. |
|
|
|
@ -74,7 +65,7 @@ $ <userinput>gmake --version</userinput> |
|
|
|
|
<Para> |
|
|
|
|
To check for disk space, use |
|
|
|
|
<programlisting> |
|
|
|
|
$ df -k |
|
|
|
|
df -k |
|
|
|
|
</programlisting> |
|
|
|
|
</para> |
|
|
|
|
|
|
|
|
@ -125,12 +116,12 @@ 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 |
|
|
|
|
<programlisting> |
|
|
|
|
$ pg_dumpall > db.out |
|
|
|
|
pg_dumpall > db.out |
|
|
|
|
</programlisting> |
|
|
|
|
If you wish to preserve object id's (oids), then use the -o |
|
|
|
|
option when running <application>pg_dumpall</application>. |
|
|
|
|
If you wish to preserve object id's (oids), then use the -o |
|
|
|
|
option when running <application>pg_dumpall</application>. |
|
|
|
|
However, unless you have a |
|
|
|
|
special reason for doing this (such as using OIDs as keys |
|
|
|
|
special reason for doing this (such as using OIDs as keys |
|
|
|
|
in tables), don't do it. |
|
|
|
|
</Para> |
|
|
|
|
|
|
|
|
@ -164,8 +155,14 @@ then back it up again. |
|
|
|
|
<Para> |
|
|
|
|
If you are upgrading an existing system then kill the database server now. Type |
|
|
|
|
<ProgramListing> |
|
|
|
|
$ ps ax | grep postmaster |
|
|
|
|
ps ax | grep postmaster |
|
|
|
|
</ProgramListing> |
|
|
|
|
or |
|
|
|
|
<ProgramListing> |
|
|
|
|
ps -e | grep postmaster |
|
|
|
|
</ProgramListing> |
|
|
|
|
(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: |
|
|
|
|
<ProgramListing> |
|
|
|
@ -176,7 +173,7 @@ Type the following line, with <replaceable>pid</replaceable> |
|
|
|
|
replaced by the process id for process <literal>postmaster</literal> |
|
|
|
|
(263 in the above case). (Do not use the id for the process "grep postmaster".) |
|
|
|
|
<programlisting> |
|
|
|
|
$ kill <replaceable>pid</replaceable> |
|
|
|
|
kill <replaceable>pid</replaceable> |
|
|
|
|
</programlisting> |
|
|
|
|
</Para> |
|
|
|
|
|
|
|
|
@ -186,7 +183,7 @@ On systems which have <productname>PostgreSQL</productname> started at boot time |
|
|
|
|
is probably a startup file which will accomplish the same thing. For example, on a |
|
|
|
|
Redhat Linux system one might find that |
|
|
|
|
<programlisting> |
|
|
|
|
$ /etc/rc.d/init.d/postgres.init stop |
|
|
|
|
/etc/rc.d/init.d/postgres.init stop |
|
|
|
|
</programlisting> |
|
|
|
|
works. |
|
|
|
|
</para> |
|
|
|
@ -195,7 +192,7 @@ works. |
|
|
|
|
<Para> |
|
|
|
|
Also move the old directories out of the way. Type the following: |
|
|
|
|
<programlisting> |
|
|
|
|
$ mv /usr/local/pgsql /usr/local/pgsql.old |
|
|
|
|
mv /usr/local/pgsql /usr/local/pgsql.old |
|
|
|
|
</programlisting> |
|
|
|
|
or replace your particular paths. |
|
|
|
|
</Para> |
|
|
|
@ -209,7 +206,7 @@ you can specify your actual installation path for the build process |
|
|
|
|
and make choices about what gets installed. Change into the <filename>src</filename> |
|
|
|
|
subdirectory and type: |
|
|
|
|
<ProgramListing> |
|
|
|
|
$ ./configure |
|
|
|
|
./configure |
|
|
|
|
</ProgramListing> |
|
|
|
|
followed by any options you might want to give it. For a first installation |
|
|
|
|
you should be able to do fine without any. |
|
|
|
@ -287,10 +284,10 @@ For a complete list of options, type: |
|
|
|
|
<Para> |
|
|
|
|
Compile the program. Type |
|
|
|
|
<ProgramListing> |
|
|
|
|
$ gmake |
|
|
|
|
gmake |
|
|
|
|
</ProgramListing> |
|
|
|
|
The compilation process can take anywhere from 10 minutes to an hour. |
|
|
|
|
Your milage will most certainly vary. |
|
|
|
|
Your milage will most certainly vary. Remember to use GNU make. |
|
|
|
|
</Para> |
|
|
|
|
|
|
|
|
|
<Para> |
|
|
|
@ -298,8 +295,6 @@ The last line displayed will hopefully be |
|
|
|
|
<programlisting> |
|
|
|
|
All of PostgreSQL is successfully made. Ready to install. |
|
|
|
|
</programlisting> |
|
|
|
|
Remember, <Quote>gmake</Quote> may be called <Quote>make</Quote> on |
|
|
|
|
your system. |
|
|
|
|
</Para> |
|
|
|
|
</Step> |
|
|
|
|
|
|
|
|
@ -307,7 +302,7 @@ your system. |
|
|
|
|
<Para> |
|
|
|
|
Install the program. Type |
|
|
|
|
<ProgramListing> |
|
|
|
|
$ gmake install |
|
|
|
|
gmake install |
|
|
|
|
</ProgramListing> |
|
|
|
|
</Para> |
|
|
|
|
</Step> |
|
|
|
@ -318,11 +313,16 @@ Tell your system how to find the new shared libraries. How to do this varies bet |
|
|
|
|
platforms. What tends to work everywhere is to set the environment variable |
|
|
|
|
<envar>LD_LIBRARY_PATH</envar>: |
|
|
|
|
<programlisting> |
|
|
|
|
$ LD_LIBRARY_PATH=/usr/local/pgsql/lib |
|
|
|
|
$ export LD_LIBRARY_PATH |
|
|
|
|
LD_LIBRARY_PATH=/usr/local/pgsql/lib |
|
|
|
|
export LD_LIBRARY_PATH |
|
|
|
|
</programlisting> |
|
|
|
|
on sh, ksh, bash, zsh or |
|
|
|
|
<programlisting> |
|
|
|
|
setenv LD_LIBRARY_PATH /usr/local/pgsql/lib |
|
|
|
|
</programlisting> |
|
|
|
|
on csh or tcsh. |
|
|
|
|
You might want to put this into a shell startup file such as |
|
|
|
|
<filename>~/.bash_profile</filename>. |
|
|
|
|
<filename>/etc/profile</filename>. |
|
|
|
|
</Para> |
|
|
|
|
|
|
|
|
|
<Para> |
|
|
|
@ -338,7 +338,7 @@ Then run command <Command>/sbin/ldconfig</Command>. |
|
|
|
|
If in doubt, refer to the manual pages of your system. If you later on get |
|
|
|
|
a message like |
|
|
|
|
<programlisting> |
|
|
|
|
./psql: error in loading shared libraries |
|
|
|
|
psql: error in loading shared libraries |
|
|
|
|
libpq.so.2.1: cannot open shared object file: No such file or directory |
|
|
|
|
</programlisting> |
|
|
|
|
then the above was necessary. Simply do this step then. |
|
|
|
@ -351,10 +351,10 @@ Create the database installation. To do this you must log in to your |
|
|
|
|
<ProductName>PostgreSQL</ProductName> superuser account. It will not |
|
|
|
|
work as root. |
|
|
|
|
<ProgramListing> |
|
|
|
|
$ mkdir /usr/local/pgsql/data |
|
|
|
|
$ chown postgres /usr/local/pgsql/data |
|
|
|
|
$ su - postgres |
|
|
|
|
$ /usr/local/pgsql/initdb -D /usr/local/pgsql/data |
|
|
|
|
mkdir /usr/local/pgsql/data |
|
|
|
|
chown postgres /usr/local/pgsql/data |
|
|
|
|
su - postgres |
|
|
|
|
/usr/local/pgsql/initdb -D /usr/local/pgsql/data |
|
|
|
|
</ProgramListing> |
|
|
|
|
</Para> |
|
|
|
|
<Para> |
|
|
|
@ -372,7 +372,7 @@ superuser, you may have to log in as root temporarily to create the data directo |
|
|
|
|
The previous step should have told you how to start up the database server. |
|
|
|
|
Do so now. |
|
|
|
|
<programlisting> |
|
|
|
|
$ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data |
|
|
|
|
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data |
|
|
|
|
</programlisting> |
|
|
|
|
This will start the server in the foreground. To make it detach to |
|
|
|
|
the background, use the <option>-S</option>. |
|
|
|
@ -383,7 +383,7 @@ the background, use the <option>-S</option>. |
|
|
|
|
<para> |
|
|
|
|
If you are upgrading from an existing installation, dump your data back in: |
|
|
|
|
<programlisting> |
|
|
|
|
$ /usr/local/pgsql/bin/psql < db.out |
|
|
|
|
/usr/local/pgsql/bin/psql -d template1 -f db.out |
|
|
|
|
</programlisting> |
|
|
|
|
You also might want to copy over the old <filename>pg_hba.conf</filename> |
|
|
|
|
file and any other files you might have had set up for authentication, such |
|
|
|
@ -421,8 +421,8 @@ and <filename>initdb</filename>. |
|
|
|
|
You probably want to install the <application>man</application> and |
|
|
|
|
<acronym>HTML</acronym> documentation. Type |
|
|
|
|
<ProgramListing> |
|
|
|
|
$ cd /usr/src/pgsql/postgresql-7.0/doc |
|
|
|
|
$ gmake install |
|
|
|
|
cd /usr/src/pgsql/postgresql-7.0/doc |
|
|
|
|
gmake install |
|
|
|
|
</ProgramListing> |
|
|
|
|
This will install files under <filename>/usr/local/pgsql/doc</filename> |
|
|
|
|
and <filename>/usr/local/pgsql/man</filename>. To enable your system |
|
|
|
@ -439,20 +439,16 @@ a Postscript printer, or have your machine already set up to accept |
|
|
|
|
Postscript files using a print filter, then to print the User's Guide |
|
|
|
|
simply type |
|
|
|
|
<programlisting> |
|
|
|
|
$ cd /usr/local/pgsql/doc |
|
|
|
|
$ gunzip -c user.ps.tz | lpr |
|
|
|
|
cd /usr/local/pgsql/doc |
|
|
|
|
gunzip -c user.ps.tz | lpr |
|
|
|
|
</programlisting> |
|
|
|
|
Here is how you might do it if you have Ghostscript on your system and are |
|
|
|
|
writing to a laserjet printer. |
|
|
|
|
<programlisting> |
|
|
|
|
$ alias gshp='gs -sDEVICE=laserjet -r300 -dNOPAUSE' |
|
|
|
|
$ export GS_LIB=/usr/share/ghostscript:/usr/share/ghostscript/fonts |
|
|
|
|
$ gunzip user.ps.gz |
|
|
|
|
$ gshp -sOUTPUTFILE=user.hp user.ps |
|
|
|
|
$ gzip user.ps |
|
|
|
|
$ lpr -l -s -r manpage.hp |
|
|
|
|
gunzip -c user.ps.gz | gs -sDEVICE=laserjet -r300 -q -dNOPAUSE -sOutputFile=- | lpr |
|
|
|
|
</programlisting> |
|
|
|
|
If in doubt, confer your manuals or your local expert. |
|
|
|
|
Printer setups can vary wildly from system to system. |
|
|
|
|
If in doubt, consult your manuals or your local expert. |
|
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
@ -551,6 +547,21 @@ instructions for running and interpreting the regression tests. |
|
|
|
|
</listitem> |
|
|
|
|
|
|
|
|
|
</itemizedlist> |
|
|
|
|
|
|
|
|
|
<Para> |
|
|
|
|
To start <quote>playing around</quote>, set up the paths as explained above |
|
|
|
|
and start the server. To create a database, type |
|
|
|
|
<ProgramListing> |
|
|
|
|
createdb testdb |
|
|
|
|
</ProgramListing> |
|
|
|
|
Then enter |
|
|
|
|
<ProgramListing> |
|
|
|
|
psql testdb |
|
|
|
|
</ProgramListing> |
|
|
|
|
to connect to that database. At the prompt you can enter SQL and start |
|
|
|
|
experimenting. |
|
|
|
|
</Para> |
|
|
|
|
|
|
|
|
|
</Sect1> |
|
|
|
|
|
|
|
|
|
</Chapter> |
|
|
|
|