• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1153
  • Last Modified:

Configuring PostgreSQL on linux red hat.

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
rosshind
Asked:
rosshind
  • 2
  • 2
2 Solutions
 
rjkimbleCommented:
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
 
earth man2Commented:
use command    initdb   first.
0
 
earth man2Commented:
set environment variable PGDATA to point to (eg) /var/lib/pgsql/data
0
 
rjkimbleCommented:
>> 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now