Added this file for documentation of maintenance tasks
[mir.git] / doc / INSTALL.postgresql
1 postgresql - installation doku - version 7.1.x
2 -------------------------------------------------------------------------------------
3
4 prerequisites:
5
6 we installed postgres on machines with debian / kernel 2.2 / jdk 1.3 (blackdown),
7 make sure you don't have postgresql installed via debian / apt-get. if you do
8 purge the installation. 
9
10 make sure you have libreadline-dev package installed, otherwise you won't be
11 able to use cursor/backspace in psql-shell.
12
13 the following things have to be done as superuser (if not otherwise stated):
14
15
16 1. get the tarball from postgresql.org
17
18 2. unzip/untar the tarball
19
20 3. configure
21
22         ./configure --enable-odbc --enable-syslog --with-perl --enable-multibyte=UNICODE \
23                     --enable-locale --enable-unicode-conversion --enable-recode --with-java
24
25 4. make
26
27  two problems with the compilation of the jdbc-driver might occur:
28
29  a) an error message "no modern / no classic-compiler"
30     to get rid of this error you have to set a link in 
31
32     /usr/lib/j2re/lib/ext     
33     to: /usr/lib/j2sdk/lib/tools.jar 
34
35  b) an error message "zip-file must have at least one entry"
36     to get rid of this error: make sure you have ant-1.3 installed
37
38 5. make install
39
40 6. pg_dumplo
41
42 you should install "pg_dumplo" from the contrib part of the postgresql-source.
43 this little programm enables you to dump the database *including* the oid (blobs). 
44
45    cd contrib/pg_dumplo
46    make
47    make install
48
49 7. the start-scripts
50
51 change to the start-scripts folder in the contrib-part.
52
53    cd ../start-scripts
54    cp linux /etc/init.d/postgresql
55    chmod a+x /etc/init.d/postgresql
56    update-rc.d postgresql defaults 
57         
58    edit the start-script in /etc/init.d/postgresql, and make sure 
59    postgresql is started with the "-i" option. to enable this insert
60    '-o "-i"' after 'start', which should look like:
61    
62         start) 
63                 $ECHO_N "Starting PostgreSQL: "$ECHO_C 
64                 su - $PGUSER -c "$DAEMON start -o '-i' -D '$PGDATA' -s -l PGLOG" 
65                 echo "ok" 
66                 ;; 
67
68
69
70 8. adding a user / starting the database
71
72    adduser postgres
73    passwd postgres
74    mkdir /usr/local/pgsql/data
75    chown postgres /usr/local/pgsql/data
76    su - postgres
77    /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
78
79    /etc/init.d/postgresql start
80    /usr/local/pgsql/bin/createdb test
81    /usr/local/pgsql/bin/psql test
82
83