Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

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…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

636 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