Configuring PostgreSQL on linux red hat.

Posted on 2004-08-06
Medium Priority
Last Modified: 2012-06-21

I'm trying to install PostgreSQL onto my linux Red Hat test environment.  I downloaded all the required RPMs then looked at the PostgressQL documentation on hte site.

The docs there seem to be for people who are making the binaries from sourse code.  They mayke no reference to how to install PostgreSQL on red hat using the rpms.

Anyway.   I installed the  database using these commands:

rpm -i postgresql-libs-7.4.3-2PGDG.i686.rpm
 rpm -i postgresql-7.4.3-2PGDG.i686.rpm
rpm -i postgresql-server-7.4.3-2PGDG.i686.rpm

thats all  I have done.  when I run createdb or  psql I get the error message:

createdb: could not connect to database template1: could not connect to server:
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I know this is a common error during configuration, but when I look at the documentation for this it doesnt make much sense because is does not seem to be correct for someone installing the rpms for red-hat.

Do I need to set environment variables somehow?

Thanks in advance

Question by:rosshind
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Accepted Solution

rjkimble earned 1200 total points
ID: 11737800
I suggest you run the following command to start PostgreSQL:

/etc/init.d/postgresql start

You should edit pg_hba.conf and postgresql.conf first. The former sets up your server's security, and the latter sets up your server's configuration. In particular, if you intend to connect to your server over TCP/IP, you need to ensure that postgresql.conf has the following line:

tcpip_socket = true

You should find both files in /var/lib/pgsql/data/ or whatever is appropriate for your installation.
LVL 22

Assisted Solution

by:earth man2
earth man2 earned 800 total points
ID: 11770643
use command    initdb   first.
LVL 22

Expert Comment

by:earth man2
ID: 11773403
set environment variable PGDATA to point to (eg) /var/lib/pgsql/data

Expert Comment

ID: 11773860
>> use command    initdb   first.

Good point. On my Mandrake 10.0 and SuSE 9.1 boxes, /etc/init.d/postgresql start will run initdb if necessary. However, on my Debian box, you would have to run initdb first if the installation process didn't do so. If you installed PostgreSQL using the standard Red Hat package, my guess is that /etc/init.d/postgresql start will run initdb if necessary. Still, it can't hurt to make sure that it has been run.

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question