11 Installation instructions for PostgreSQL 7.0.
22
3- Commands were tested on RedHat Linux version 5.2 using the bash shell.
4- Except where noted, they will probably work on most systems. Commands like
5- ps and tar may vary wildly between platforms on what options you should use.
6- Use common sense before typing in these commands.
7-
83If you haven't gotten the PostgreSQL distribution, get it from
94ftp.postgresql.org, then unpack it:
105
11- $ gunzip postgresql-7.0.tar.gz
12- $ tar -xf postgresql-7.0.tar
13- $ mv postgresql-7.0 /usr/src
14-
15- Again, these commands might differ on your system.
6+ gunzip postgresql-7.0.tar.gz
7+ tar -xf postgresql-7.0.tar
8+ mv postgresql-7.0 /usr/src
169
1710Before you start
1811
@@ -22,7 +15,7 @@ systems you may find that GNU make is installed under the name "gmake". We
2215will use that name from now on to indicate GNU make, no matter what name it
2316has on your system. To test for GNU make enter
2417
25- $ gmake --version
18+ gmake --version
2619
2720If you need to get GNU make, you can find it at ftp://ftp.gnu.org.
2821
@@ -46,7 +39,7 @@ extra 20MB.
4639
4740To check for disk space, use
4841
49- $ df -k
42+ df -k
5043
5144Considering today's prices for hard disks, getting a large and fast hard
5245disk should probably be in your plans before putting a database into
@@ -77,7 +70,7 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
7770 You now need to back up your existing database. To dump your fairly
7871 recent post-6.0 database installation, type
7972
80- $ pg_dumpall > db.out
73+ pg_dumpall > db.out
8174
8275 If you wish to preserve object id's (oids), then use the -o option when
8376 running pg_dumpall. However, unless you have a special reason for doing
@@ -96,14 +89,18 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
9689 backup. If necessary, bring down postmaster, edit the permissions in file
9790 /usr/local/pgsql/data/pg_hba.conf to allow only you on, then bring
9891 postmaster back up.
99-
10092 3. If you are upgrading an existing system then kill the database server
10193 now. Type
10294
103- $ ps ax | grep postmaster
95+ ps ax | grep postmaster
96+
97+ or
10498
105- This should list the process numbers for a number of processes, similar
106- to this:
99+ ps -e | grep postmaster
100+
101+ (It depends on your system which one of these two works. No harm can be
102+ done by typing the wrong one.) This should list the process numbers for
103+ a number of processes, similar to this:
107104
108105 263 ? SW 0:00 (postmaster)
109106 777 p1 S 0:00 grep postmaster
@@ -112,20 +109,20 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
112109 process postmaster (263 in the above case). (Do not use the id for the
113110 process "grep postmaster".)
114111
115- $ kill pid
112+ kill pid
116113
117114 Tip: On systems which have PostgreSQL started at boot time,
118115 there is probably a startup file which will accomplish the
119116 same thing. For example, on a Redhat Linux system one might
120117 find that
121118
122- $ /etc/rc.d/init.d/postgres.init stop
119+ /etc/rc.d/init.d/postgres.init stop
123120
124121 works.
125122
126123 Also move the old directories out of the way. Type the following:
127124
128- $ mv /usr/local/pgsql /usr/local/pgsql.old
125+ mv /usr/local/pgsql /usr/local/pgsql.old
129126
130127 or replace your particular paths.
131128
@@ -134,7 +131,7 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
134131 make choices about what gets installed. Change into the src
135132 subdirectory and type:
136133
137- $ ./configure
134+ ./configure
138135
139136 followed by any options you might want to give it. For a first
140137 installation you should be able to do fine without any. For a complete
@@ -176,30 +173,32 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
176173
177174 5. Compile the program. Type
178175
179- $ gmake
176+ gmake
180177
181178 The compilation process can take anywhere from 10 minutes to an hour.
182- Your milage will most certainly vary.
179+ Your milage will most certainly vary. Remember to use GNU make.
183180
184181 The last line displayed will hopefully be
185182
186183 All of PostgreSQL is successfully made. Ready to install.
187184
188- Remember, "gmake" may be called "make" on your system.
189-
190185 6. Install the program. Type
191186
192- $ gmake install
187+ gmake install
193188
194189 7. Tell your system how to find the new shared libraries. How to do this
195190 varies between platforms. What tends to work everywhere is to set the
196191 environment variable LD_LIBRARY_PATH:
197192
198- $ LD_LIBRARY_PATH=/usr/local/pgsql/lib
199- $ export LD_LIBRARY_PATH
193+ LD_LIBRARY_PATH=/usr/local/pgsql/lib
194+ export LD_LIBRARY_PATH
195+
196+ on sh, ksh, bash, zsh or
200197
201- You might want to put this into a shell startup file such as
202- ~/.bash_profile.
198+ setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
199+
200+ on csh or tcsh. You might want to put this into a shell startup file
201+ such as /etc/profile.
203202
204203 On some systems the following is the preferred method, but you must
205204 have root access. Edit file /etc/ld.so.conf to add a line
@@ -211,18 +210,18 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
211210 If in doubt, refer to the manual pages of your system. If you later on
212211 get a message like
213212
214- ./ psql: error in loading shared libraries
213+ psql: error in loading shared libraries
215214 libpq.so.2.1: cannot open shared object file: No such file or directory
216215
217216 then the above was necessary. Simply do this step then.
218217
219218 8. Create the database installation. To do this you must log in to your
220219 PostgreSQL superuser account. It will not work as root.
221220
222- $ mkdir /usr/local/pgsql/data
223- $ chown postgres /usr/local/pgsql/data
224- $ su - postgres
225- $ /usr/local/pgsql/initdb -D /usr/local/pgsql/data
221+ mkdir /usr/local/pgsql/data
222+ chown postgres /usr/local/pgsql/data
223+ su - postgres
224+ /usr/local/pgsql/initdb -D /usr/local/pgsql/data
226225
227226 The -D option specifies the location where the data will be stored. You
228227 can use any path you want, it does not have to be under the
@@ -235,15 +234,15 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
235234 9. The previous step should have told you how to start up the database
236235 server. Do so now.
237236
238- $ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
237+ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
239238
240239 This will start the server in the foreground. To make it detach to the
241240 background, use the -S.
242241
243242 10. If you are upgrading from an existing installation, dump your data back
244243 in:
245244
246- $ /usr/local/pgsql/bin/psql< db.out
245+ /usr/local/pgsql/bin/psql-d template1 -f db.out
247246
248247 You also might want to copy over the old pg_hba.conf file and any other
249248 files you might have had set up for authentication, such as password
@@ -266,8 +265,8 @@ suggestions.
266265
267266 * You probably want to install the man and HTML documentation. Type
268267
269- $ cd /usr/src/pgsql/postgresql-7.0/doc
270- $ gmake install
268+ cd /usr/src/pgsql/postgresql-7.0/doc
269+ gmake install
271270
272271 This will install files under /usr/local/pgsql/doc and
273272 /usr/local/pgsql/man. To enable your system to find the man
@@ -281,20 +280,16 @@ suggestions.
281280 Postscript files using a print filter, then to print the User's Guide
282281 simply type
283282
284- $ cd /usr/local/pgsql/doc
285- $ gunzip -c user.ps.tz | lpr
283+ cd /usr/local/pgsql/doc
284+ gunzip -c user.ps.tz | lpr
286285
287286 Here is how you might do it if you have Ghostscript on your system and
288287 are writing to a laserjet printer.
289288
290- $ alias gshp='gs -sDEVICE=laserjet -r300 -dNOPAUSE'
291- $ export GS_LIB=/usr/share/ghostscript:/usr/share/ghostscript/fonts
292- $ gunzip user.ps.gz
293- $ gshp -sOUTPUTFILE=user.hp user.ps
294- $ gzip user.ps
295- $ lpr -l -s -r manpage.hp
289+ gunzip -c user.ps.gz | gs -sDEVICE=laserjet -r300 -q -dNOPAUSE -sOutputFile=- | lpr
296290
297- If in doubt, confer your manuals or your local expert.
291+ Printer setups can vary wildly from system to system. If in doubt,
292+ consult your manuals or your local expert.
298293
299294 The Adminstrator's Guide should probably be your first reading if you
300295 are completely new to PostgreSQL, as it contains information about how
@@ -352,3 +347,15 @@ suggestions.
352347 into production use. The file
353348 /usr/src/pgsql/postgresql-7.0/src/test/regress/README has detailed
354349 instructions for running and interpreting the regression tests.
350+
351+ To start "playing around", set up the paths as explained above and start the
352+ server. To create a database, type
353+
354+ createdb testdb
355+
356+ Then enter
357+
358+ psql testdb
359+
360+ to connect to that database. At the prompt you can enter SQL and start
361+ experimenting.