Installing Postgresql 7.1 on Red Hat 7.1 Dennis G. Allard May 7, 2002 http://oceanpark.com/notes/postgres71_install_on_RedHat71_020507.txt ________________________________________________________________________ I noticed posts to muc.lists.postgres.questions asking how to install Postgres 7.1 on RH 7.1. (including one by bens@benjamindsmith.com). I tried to post a reply via GoogleGroups but some kind of bounce message came back owing to the newsgroup being moderated and the moderator not being known or something like that. Here is my 'post'... I achieved this by downloading RPMs from: ftp://ftp.us.postgresql.org/binary/v7.1.3/RPMS/redhat-7.1/ Then I installed the RPMs as follows: [root@oceanpark /]# ls /home/mirror/*postgres* /home/mirror/postgresql-7.1.3-1PGDG.i386.rpm /home/mirror/postgresql-libs-7.1.3-1PGDG.i386.rpm /home/mirror/postgresql-server-7.1.3-1PGDG.i386.rpm [root@oceanpark /]# [root@oceanpark /]# rpm --install /home/mirror/postgresql-libs-7.1.3-1PGDG.i386.rpm [root@oceanpark /]# rpm --install /home/mirror/postgresql-7.1.3-1PGDG.i386.rpm [root@oceanpark /]# rpm --install /home/mirror/postgresql-server-7.1.3-1PGDG.i386.rpm [root@oceanpark /]# I then more or less followed guidelines in the online PostgreSQL 7.2.1 Administrator's Guide: (e.g., http://www.postgresql.org/idocs/index.php?admin.html) [root@oceanpark /]# useradd postgres [root@oceanpark /]# [root@oceanpark /]# su - postgres [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ pwd /home/postgres [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ mkdir database [postgres@oceanpark postgres]$ ls -l total 8 drwxrwxr-x 2 postgres postgres 4096 May 7 13:26 database drwxr-xr-x 2 postgres postgres 4096 May 7 08:44 Desktop [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ export PGDATA=/home/postgres/database [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ printenv | grep -i pg PGDATA=/home/postgres/database [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ initdb This database system will be initialized with username "postgres". This user will own all the data files and must also own the server process. Fixing permissions on existing directory /home/postgres/database Creating directory /home/postgres/database/base Creating directory /home/postgres/database/global Success. You can now start the database server using: /usr/bin/postmaster -D /home/postgres/database or /usr/bin/pg_ctl -D /home/postgres/database -l logfile start [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ export PGLOG=/home/postgres/log [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ printenv | grep -i pg PGLOG=/home/postgres/log PGDATA=/home/postgres/database [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ /usr/bin/pg_ctl -D $PGDATA -l $PGLOG start postmaster successfully started [postgres@oceanpark postgres]$ [postgres@oceanpark postgres]$ createdb mf CREATE DATABASE (you are on your own from here). Note, I also noticed that the RPMs had left the Red Hat standard SysV startup script but it failed to start: [root@oceanpark /]# /etc/rc.d/init.d/postgresql start Starting postgresql service: FAILED I was not in the mood to debug that script, especially since the Postgres documentation describes startup in terms of direct invocation of the above pg_ctl program. I'm sure that when I next upgrade Red Hat (say to 7.3), I will be sure to install Postgres out of the box so that the init.d style startup works. If fact, the best way to install and maintain software on Red Hat is simply to always 'Install Everything' and keep things up to date via the excellent up2date Red Hat network tool. -- Dennis G. Allard telephone: 1.310.399.4740 Ocean Park Software http://oceanpark.com ________________________________________________________________________