#native_company# #native_desc#

Getting Started With Postgres on Red Hat 7.0 Page 3

By Kevin Kemp
on March 14, 2001

Step 5: Getting PostgreSQL to start on reboot

1) At the command line type linuxconf
2) Click on the control tab
3) Expand the control panel and click on control service activity
4) Scroll down until you find PostgreSQL and click on it
5) Click on the run levels tab
6) Click on Level 2, 3, and 5
7) Click on the Basic info tab and click on automatic
8) Click on accept and quit linuxconf
9) PostgreSQL should now start up automatically on reboot.

Step 6: Creating Users and Databases

1) At the command prompt type su postgres
2) To create a user type createuser phpuser (phpuser is the user to be created) You will be asked whether this user
can create databases and users. For this example say yes to both.
3) To create a database type createdb phpdb (phpdb is the database to be created)
4) Type exit to leave the postgres user command prompt
5) To log into the newly created database. Type in psql phpdb -U phpuser
(This connects us to the phpdb database as user phpuser)
6) Type in q to log out of the database

Step 7: Access configuration to allow remote computer connections

1) In this example I want to allow all users from the computer with the ip address of to access all
of the databases.
2) To do this I need to edit the pg_hba.conf file
3) It is in the directory /var/lib/pgsql/data
4) I will open this to be edited (This file is well documented so I will be brief here)
5) At the end of the file I am going to add a line that looks like this:
host    all   trust
I highly recommend setting passwords for access to any database and setting passwords for any of the users that
may be created, most importantly any user that has rights to create other users as this user has access to the entire
postgres system. This includes the user postgres. This could be devistating to your system as postgres can run
C programs as procedures. Do I need to say any more?
I hope that this write up has been helpful. If there is enough interest in setting up postgres for Windows I will
write up how to get it running.
— Kevin