1
1
Installation instructions for PostgreSQL 7.0.
2
2
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
-
8
3
If you haven't gotten the PostgreSQL distribution, get it from
9
4
ftp.postgresql.org, then unpack it:
10
5
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
16
9
17
10
Before you start
18
11
@@ -22,7 +15,7 @@ systems you may find that GNU make is installed under the name "gmake". We
22
15
will use that name from now on to indicate GNU make, no matter what name it
23
16
has on your system. To test for GNU make enter
24
17
25
- $ gmake --version
18
+ gmake --version
26
19
27
20
If you need to get GNU make, you can find it at ftp://ftp.gnu.org.
28
21
@@ -46,7 +39,7 @@ extra 20MB.
46
39
47
40
To check for disk space, use
48
41
49
- $ df -k
42
+ df -k
50
43
51
44
Considering today's prices for hard disks, getting a large and fast hard
52
45
disk 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:
77
70
You now need to back up your existing database. To dump your fairly
78
71
recent post-6.0 database installation, type
79
72
80
- $ pg_dumpall > db.out
73
+ pg_dumpall > db.out
81
74
82
75
If you wish to preserve object id's (oids), then use the -o option when
83
76
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:
96
89
backup. If necessary, bring down postmaster, edit the permissions in file
97
90
/usr/local/pgsql/data/pg_hba.conf to allow only you on, then bring
98
91
postmaster back up.
99
-
100
92
3. If you are upgrading an existing system then kill the database server
101
93
now. Type
102
94
103
- $ ps ax | grep postmaster
95
+ ps ax | grep postmaster
96
+
97
+ or
104
98
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:
107
104
108
105
263 ? SW 0:00 (postmaster)
109
106
777 p1 S 0:00 grep postmaster
@@ -112,20 +109,20 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
112
109
process postmaster (263 in the above case). (Do not use the id for the
113
110
process "grep postmaster".)
114
111
115
- $ kill pid
112
+ kill pid
116
113
117
114
Tip: On systems which have PostgreSQL started at boot time,
118
115
there is probably a startup file which will accomplish the
119
116
same thing. For example, on a Redhat Linux system one might
120
117
find that
121
118
122
- $ /etc/rc.d/init.d/postgres.init stop
119
+ /etc/rc.d/init.d/postgres.init stop
123
120
124
121
works.
125
122
126
123
Also move the old directories out of the way. Type the following:
127
124
128
- $ mv /usr/local/pgsql /usr/local/pgsql.old
125
+ mv /usr/local/pgsql /usr/local/pgsql.old
129
126
130
127
or replace your particular paths.
131
128
@@ -134,7 +131,7 @@ For a fresh install or upgrading from previous releases of PostgreSQL:
134
131
make choices about what gets installed. Change into the src
135
132
subdirectory and type:
136
133
137
- $ ./configure
134
+ ./configure
138
135
139
136
followed by any options you might want to give it. For a first
140
137
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:
176
173
177
174
5. Compile the program. Type
178
175
179
- $ gmake
176
+ gmake
180
177
181
178
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.
183
180
184
181
The last line displayed will hopefully be
185
182
186
183
All of PostgreSQL is successfully made. Ready to install.
187
184
188
- Remember, "gmake" may be called "make" on your system.
189
-
190
185
6. Install the program. Type
191
186
192
- $ gmake install
187
+ gmake install
193
188
194
189
7. Tell your system how to find the new shared libraries. How to do this
195
190
varies between platforms. What tends to work everywhere is to set the
196
191
environment variable LD_LIBRARY_PATH:
197
192
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
200
197
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.
203
202
204
203
On some systems the following is the preferred method, but you must
205
204
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:
211
210
If in doubt, refer to the manual pages of your system. If you later on
212
211
get a message like
213
212
214
- ./ psql: error in loading shared libraries
213
+ psql: error in loading shared libraries
215
214
libpq.so.2.1: cannot open shared object file: No such file or directory
216
215
217
216
then the above was necessary. Simply do this step then.
218
217
219
218
8. Create the database installation. To do this you must log in to your
220
219
PostgreSQL superuser account. It will not work as root.
221
220
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
226
225
227
226
The -D option specifies the location where the data will be stored. You
228
227
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:
235
234
9. The previous step should have told you how to start up the database
236
235
server. Do so now.
237
236
238
- $ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
237
+ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
239
238
240
239
This will start the server in the foreground. To make it detach to the
241
240
background, use the -S.
242
241
243
242
10. If you are upgrading from an existing installation, dump your data back
244
243
in:
245
244
246
- $ /usr/local/pgsql/bin/psql < db.out
245
+ /usr/local/pgsql/bin/psql -d template1 -f db.out
247
246
248
247
You also might want to copy over the old pg_hba.conf file and any other
249
248
files you might have had set up for authentication, such as password
@@ -266,8 +265,8 @@ suggestions.
266
265
267
266
* You probably want to install the man and HTML documentation. Type
268
267
269
- $ cd /usr/src/pgsql/postgresql-7.0/doc
270
- $ gmake install
268
+ cd /usr/src/pgsql/postgresql-7.0/doc
269
+ gmake install
271
270
272
271
This will install files under /usr/local/pgsql/doc and
273
272
/usr/local/pgsql/man. To enable your system to find the man
@@ -281,20 +280,16 @@ suggestions.
281
280
Postscript files using a print filter, then to print the User's Guide
282
281
simply type
283
282
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
286
285
287
286
Here is how you might do it if you have Ghostscript on your system and
288
287
are writing to a laserjet printer.
289
288
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
296
290
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.
298
293
299
294
The Adminstrator's Guide should probably be your first reading if you
300
295
are completely new to PostgreSQL, as it contains information about how
@@ -352,3 +347,15 @@ suggestions.
352
347
into production use. The file
353
348
/usr/src/pgsql/postgresql-7.0/src/test/regress/README has detailed
354
349
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.
0 commit comments