Solved

Configuring PostgreSQL on linux red hat.

Posted on 2004-08-06
4
1,138 Views
Last Modified: 2012-06-21
Hi,

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


0
Comment
Question by:rosshind
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
rjkimble earned 300 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.
0
 
LVL 22

Assisted Solution

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

Expert Comment

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

Expert Comment

by:rjkimble
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now