Re: Newbie: problem Connecting to Server - Mailing list pgsql-general

From alex b.
Subject Re: Newbie: problem Connecting to Server
Date
Msg-id 3E8C9C9B.7050006@gmx.de
Whole thread Raw
In response to Re: Newbie: problem Connecting to Server  ("Frustrated Beginner" <nowweare@access4cheap.com>)
List pgsql-general
Frustrated Beginner wrote:
> I am having this exact same problem.  Any help would be greatly appreciated.
> Thank you.
>
>
>
> "Ferindo Middleton Jr" <ferindo.middleton@verizon.net> wrote in message
> news:pan.2003.03.31.01.23.34.434512@verizon.net...
>
>>I'm running Redhat Linux 8. I have registration to the Redhat Network so
>>I'm probably running the latest version of postgre sql available. I also
>>have Redhat Databse v2.1 installed, but whenever I try to start a session,
>>I get the following error message:
>>
>>psql: could not connect to server: No such file or directory
>>        Is the server running locally and accepting
>>        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
>>
>>Please help me configure my system so that I can connect and begin to use
>>postgresql.


  you guys first have to create a POSTGRESQL USER, under which the
server will run...

in other words: the server (postmaster) must be running, which it is
not, apparently.

/tmp/.s.PGSQL.5432
is a unix socket, to which the client connects. the postgresql-server
creates that socket itself.
since you guys are running redhat, you should be able to set the scripts
to started at boot time in different runlevels (runlevel editor) and
select postgresql to be started... as root as a matter of course.



if none of that works, then try the following as  root:

first uninstall the postgresql, download the kernelheaders to your
current kernel, download the current postgresql-sources (7.3.2), compile
that, and install (make install - as root)

follow these directions (all as root):
- create the user "postgres" belonging to group "daemon"
- mkdir /usr/local/pgsql/logs
- mkdir /usr/local/pgsql/data
- chmod 700 /usr/local/pgsql/data
- echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf
- ldconfig
- chown -R postgres:daemon /usr/local/pgsql
- su postgres -c '/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data'
- su postgres -c '/usr/local/pgsql/bin/postmaster -D
/usr/local/pgsql/data >> /usr/local/pgsql/logs/server.log 2>&1' &
(all in one line)

and you're done, you may now create a new and fresh database, just like
this:

- su postgres -c '/usr/local/pgsql/bin/createdb <databasename>'

notice that "su postgres .." command... it is because postmaster (the
server binary) likes to be started as a user and not as root, since that
would be a dangerous act. all programs can be exploited and evil, evil
badboys could gain root privileges and destroy the whole world...
postgresql simply won't start as root - security issues.




ANYONE: please correct me, if I'm wrong!!!!! it is important, so I or
them won't mess up their systems..



cheers,
  alex


pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: Re: SAPdb vs. Postgresql
Next
From: Tom Lane
Date:
Subject: Re: pgsql password when FreeBSD boots -- what's usual?