PostgreSQL

RedHat has switched from MySQL to PostgreSQL which is a more advanced DB server supporting stored procedures and functions. The PostgreSQL site is at http://www.postgresql.org/

I have the following rpms on my system:

  • postgresql-7.1.3-2
  • postgresql-devel-7.1.3-2
  • postgresql-libs-7.1.3-2
  • postgresql-server-7.1.3-2
  • php-pgsql-4.0.6-7

If you want to install from source try the following, but the install paths will be different.

./configure  gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

PostgreSQL commands are installed in /usr/bin

The data directory is in /var/lib/pqsql/data

To start the server run

/etc/rc.d/init.d/postgresql start

You have to create a user before you can make a database. Checking the /etc/passwd file I found that a user called postgres already existed.

 

Share

Leave a Comment