SHARE
Facebook X Pinterest WhatsApp

Making PostgreSQL work in Red Hat 5.2

Written By
thumbnail
Web Webster
Web Webster
Jun 3, 1999

By Tom Adelstein.

If you want to use this database follow this procedure

Linux users have enjoyed a good relationship with the BSD
database PostgreSQL over the years. Unfortunately, if you use Red
Hat 5.2 you will discover a documentation discrepancy. The
documentation that comes with PostgreSQL and loads into the
director /usr/doc/postgresql 6.3.x in Red Hat and what you must do
to get it to work differ substantially.

Red Hat Linux 5.2 comes with version 6.3.x of PostgreSQL. During
installation, you will have the option of installing this database.
Also, after the applications have been installed on your hard
drive, you will be given the option of having PostgreSQL start at
boot time. Choose this option, because in order for PostgreSQL to
work, the daemon – postmaster – must run.

After your very first boot and before you start X, login as root
and type “linuxconf”, a menu will appear. Select the option for
‘user accounts’ and press enter. You select options in this utility
by highlighting them.

A screen will appear with user accounts listed. Most of these
accounts are daemon or service accounts such as ftp. You will see
the account ‘postgres’ which will be labeled the PostgreSQL
superuser account.

You need to do two things at this point, give the postgres user a
password and create just a regular user account which will manage
databases. You accomplish the first task by highlighting the
postgres account and pressing enter. The screen will change. Tab
over to the password button and press enter. You will be prompted
twice to enter the password. The first time to just type the
password in the form and the second to verify the password was
typed correctly. If you entered both correctly, then you will
return to the screen listing users.

Next, tab over to the ‘add user’ button. Press enter and add your
first regular user. Type in lower case an eight digit account name.
Then with your cursor key go to the next line and type the full
name of the user. Under type of user type ‘users’. Do not worry
about anything else just tab to accept. Now, as you did with the
postgres user, give the new user a password.

Once you have accepted these changes, you will select the quit
button and then the activate changes button and then you will quit
again and be back at the command line cursor.

At this point you will want to log out of the root account. Once
out, login as the new user and issue the command ‘ls -a’ and you
will see several files. The file .bash_profile needs to be changed.
Regardless of what the PostgreSQL documentation says, you need to
add text to the .bash_profile file. Using the vi editor, open the
file go into the edit mode and add to the end of the ‘PATH=’ line
‘:/var/lib/pgsql’. Don’t type the quotation marks. Now save the
edit by pressing escape two times, then shift colon (:) and w!
enter. Next, press the shift colon and enter q and the return or
enter key and you will be back at your prompt.

Log out of the user account and log into ‘postgres’. At the command
line prompt type ‘createuser’ (without the quotes). You will get a
prompt to enter the user name. Enter your user name and select the
defaults. When finished the user should have the rights to create a
database and give users access to the database.

Finally, logout by typing exit. Login as the user once again. Type
‘createdb’, again without the quotes, and you will see that you
have a database with your user’s name.

If you follow these instructions, you can then begin to use the SQL
statements in the postgresql tutorial. You can start creating
tables and embed commands in HTML and all the other good stuff.
Otherwise, spend days being frustrated and don’t get anything done.
You’ll also miss out on a Linux legend.

thumbnail
Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Recommended for you...

Red Hat reveals major enhancements to Red Hat Enterprise Linux AI
sjvn
Oct 22, 2024
How to Find AWS EC2 Instance Type Over SSH (6 Methods)
Benny Lanco
Sep 23, 2024
Crond: Daemon to Execute Scheduled Commands
Rose Hosting Blog
Sep 20, 2024
A Detailed Introduction to Oracle VirtualBox
Senthil Kumar
Sep 19, 2024
Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.