Index: openacs-4/packages/acs-core-docs/www/postgres.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/postgres.html,v diff -u -r1.21.2.6 -r1.21.2.7 --- openacs-4/packages/acs-core-docs/www/postgres.html 18 Dec 2003 10:04:26 -0000 1.21.2.6 +++ openacs-4/packages/acs-core-docs/www/postgres.html 11 Jan 2004 12:45:46 -0000 1.21.2.7 @@ -1,7 +1,7 @@ -
by Vinod Kurup
+by Vinod Kurup
Skip this section if you will run only Oracle.
OpenACS 5.0.0b4 will run with PostgreSQL 7.2.x, 7.3.2, 7.3.3, and 7.3.4. 7.3.4 is the recommended version of PostgreSQL. PostgreSQL 7.4 has been verified.
Skip this section if you will run only Oracle.
OpenACS 5.0.0rc1 will run with PostgreSQL 7.2.x, 7.3.2, 7.3.3, and 7.3.4. 7.3.4 is the recommended version of PostgreSQL. PostgreSQL 7.4 has been verified.
Mac OS X.�If you are running Mac OS X prior to 10.3, you should be able to install and use PostGreSQL 7.2.x or 7.3.x. Mac OS X 10.3 requires PostGreSQL 7.4.
Debian users can install the package and add some backwards-compatibility links:
apt-get install postgresql postgresql-dev postgresql-doc
ln -s /usr/include/postgresql/ /usr/include/pgsql
ln -s /var/lib/postgres /usr/local/pgsql
ln -s /usr/include/pgsql /usr/local/pgsql/include
@@ -22,20 +22,20 @@
[root root]# groupadd web
[root root]# su - postgres
-bash-2.05b$
-
+
ln -s /usr/lib/pgsql/ /var/lib/pgsql/lib
ln -s /var/lib/pgsql /usr/local/pgsql
service postgresql start
echo "export LD_LIBRARY_PATH=/usr/local/pgsql/lib" >> ~postgres/.bash_profile
echo "export PATH=$PATH:/usr/local/pgsql/bin" >> ~postgres/.bash_profile
groupadd web
-su - postgres
... and then skip to 6. Something similar may work for other binary packages as well.
Unpack PostgreSQL.�If you have not downloaded the postgresql tarball to +su - postgres
... and then skip to 6. Something similar may work for other binary packages as well.
Unpack PostgreSQL.�If you have not downloaded the postgresql tarball to /tmp/postgresql-7.3.4.tar.gz, get it.
[root root]# cd /usr/local/src
[root src]# tar xzf /tmp/postgresql-7.3.4.tar.gz
[root src]#
-cd /usr/local/src
-tar xzf /tmp/postgresql-7.3.4.tar.gz
Create the Postgres user.� +
cd /usr/local/src
+tar xzf /tmp/postgresql-7.3.4.tar.gz
Create the Postgres user.�
Create a user and group (if you haven't done so before) for
PostgreSQL. This is the account that PostgreSQL will run as
since it will not run as root. Since nobody will log in
@@ -46,11 +46,11 @@
[root src]# chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.3.4
[root src]# chmod 750 /usr/local/pgsql
[root src]#
-groupadd web
+ Mac OS X: Do instead: Mac OS X: Do instead: The second command returns a list of groups. The last entry should include the gid of the group web, which you will need in the next sequence: Start PostgreSQL.�
+make install Start PostgreSQL.�
The initdb command initializes the
database. pg_ctl is used to start up
PostgreSQL.
@@ -109,8 +109,8 @@
[postgres tsearch]$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start
postmaster successfully started
[postgres tsearch]$
-/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
-/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start
+
PostgreSQL errors will be logged in
/usr/local/pgsql/data/server.log
Install Pl/pgSQL.�Set up plpgsq and allow your user to have
@@ -126,8 +126,8 @@
(1 row)
[postgres pgsql]$
-createlang plpgsql template1
-createlang -l template1 Test PostgreSQL (OPTIONAL).�Create a database and try some simple commands. The output should be as shown.
+ Test PostgreSQL (OPTIONAL).�Create a database and try some simple commands. The output should be as shown.
Red Hat RPM: The init script is already installed; just turn it on for the appropriate run levels. Red Hat from source: Red Hat from source: Test the script. Test the script. If PostgreSQL successfully stopped, then use the following
command to make sure that the script is run appropriately at boot
@@ -188,16 +188,16 @@
[root root]# service postgresql start
Starting PostgreSQL: ok
[root root]#
-chkconfig --add postgresql
+ Debian: Debian: Test the script Test the script If PostgreSQL successfully stopped, then use the following
command to make sure that the script is run
@@ -223,7 +223,7 @@
rc.d/ part in each of the
following commands.
-
groupadd web
useradd -g web -d /usr/local/pgsql postgres
mkdir -p /usr/local/pgsql
chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.3.4
-chmod 750 /usr/local/pgsql
sudo niutil -create / /groups/web
+chmod 750 /usr/local/pgsql
sudo niutil -create / /groups/web
sudo niutil - list / /groups
sudo niutil -create / /users/postgres
sudo niutil -createprop / /users/postgres gid web's gid_number
sudo niutil -createprop / /users/postgres home /usr/local/pgsql
@@ -71,7 +71,7 @@
Change to the postgres user and run ./configure to set the compilation options automatically. This is the point at which you can
configure PostgreSQL in various ways. For example, if you want to
enable
- Unicode support, add the flags --enable-locale and --enable-multibyte. If you want to see what the other possibilities are, run ./configure --help.
+ Unicode support, add the flags --enable-locale and --enable-multibyte. If you want to see what the other possibilities are, run ./configure --help.
[root src]# su - postgres
[postgres pgsql]$ cd /usr/local/src/postgresql-7.3.4
[postgres postgresql-7.3.4]$ ./configure
@@ -92,11 +92,11 @@
(many lines omitted)
Thank you for choosing PostgreSQL, the most advanced open source database
engine.
-su - postgres
+
su - postgres
cd /usr/local/src/postgresql-7.3.4
./configure
make all
-make install
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
+/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start
createlang plpgsql template1
+createlang -l template1
[postgres pgsql]$ createdb mytestdb
CREATE DATABASE
[postgres pgsql]$ psql mytestdb
@@ -168,13 +168,13 @@
state. Red Hat and Debian and SuSE each work a little
differently.
[root root]# chkconfig --level 345 postgresql on
-[root root]#
[root src]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
+[root root]#
[root src]# cp /tmp/openacs-5.0.0rc1/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
[root src]# chown root.root /etc/rc.d/init.d/postgresql
[root src]# chmod 755 /etc/rc.d/init.d/postgresql
[root src]#
-cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
+
cp /tmp/openacs-5.0.0rc1/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
chown root.root /etc/rc.d/init.d/postgresql
-chmod 755 /etc/rc.d/init.d/postgresql
[root root]# service postgresql stop
+chmod 755 /etc/rc.d/init.d/postgresql
[root root]# service postgresql stop
Stopping PostgreSQL: ok
[root root]#
chkconfig --add postgresql
chkconfig --level 345 postgresql on
chkconfig --list postgresql
-service postgresql start
[root ~]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
+service postgresql start
[root ~]# cp /tmp/openacs-5.0.0rc1/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
[root ~]# chown root.root /etc/init.d/postgresql
[root ~]# chmod 755 /etc/init.d/postgresql
-[root ~]#
-cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
+[root ~]#
+cp /tmp/openacs-5.0.0rc1/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
chown root.root /etc/init.d/postgresql
-chmod 755 /etc/init.d/postgresql
[root ~]# /etc/init.d/postgresql stop
+chmod 755 /etc/init.d/postgresql
[root ~]# /etc/init.d/postgresql stop
Stopping PostgreSQL: ok
[root ~]#
[root ~]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/rc.d/init.d/postgresql
+
[root ~]# cp /tmp/openacs-5.0.0rc1/packages/acs-core-docs/www/files/postgresql.txt /etc/rc.d/init.d/postgresql
[root ~]# chown root.root /etc/rc.d/init.d/postgresql
[root ~]# chmod 755 /etc/rc.d/init.d/postgresql