Thread: Problem starting a session

Problem starting a session

From
"news.verizon.net"
Date:
[root@localhost root]# psql test
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"?

anybody know why I'm getting this error message..... I'm a newbie... please
point me in the right direction.



Re: Problem starting a session

From
Justin Clift
Date:
news.verizon.net wrote:
>
> [root@localhost root]# psql test
> 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"?
>
> anybody know why I'm getting this error message..... I'm a newbie... please
> point me in the right direction.

Hi Ferindo,

Any idea if PostgreSQL was started with the option to tell it that it
needs to communicate over the network?  By default it uses a system
called Unix Domain Sockets, and doesn't listen to the network.

If you're not sure, then in the PostgreSQL "data" directory there is a
file called "postgresql.conf".  You'll need to change the option there
called "tcpip_socket" to be "true", then restart PostgreSQL.  It should
work after that.

Hope that helps.

:-)

Regards and best wishes,

Justin Clift


--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi


Re: Problem starting a session

From
"news.verizon.net"
Date:
Erwin Moller,

I made the configuration settings you mentioned in the thread below, but I'm
still getting the same error message below. It seems that I've now setup the
server to accept TCP/IP connections ans except connections/requests from all
local users on my system, but I'm still getting the same error message.....
I don't understand what's wrong because when I go into the 'services'  on my
redhat linux 8 machine and restart the service postgresql, it restarts the
server acceptionally - without any problems reported.... is their anything
I'm missing that needs to be done to setup a user account and define the
area where their database info and all is.... I've bought this book on
postgre sql, but the book assumes you already have ther server setup to
accept users.

"Erwin Moller" <erwin@_removespam_dexus.nl> wrote in message
news:3E3A7750.40000@_removespam_dexus.nl...
> news.verizon.net wrote:
> > [root@localhost root]# psql test
> > 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"?
> >
> > anybody know why I'm getting this error message..... I'm a newbie...
please
> > point me in the right direction.
> >
> >
>
> Hi, another newbie answering :-)
>
>
> You get this error because you cannot connect to the server.
> two reasons:
> 1) server is not running
> test: type into console:
>
> pg_ctl status
>
>
> You will get a response that will make clear if the postmaster is running
>
> 2) Your postgresql server isn't accepting TCP/IP connections.
>
> You need (possibly) to do two things to repair this.
> 2a) Did you start postgres with TCP/IP support on?
> to check this you can check the file postgresql.conf in your data
directory:
> in my case: /usr/local/pgsql/data/postgresql.conf
>
> It should contain:
>
> #
> # Connection Parameters
> #
> tcpip_socket = true
> #ssl = false
> <blabla>
> port = 5432
>
>
> 2b) Postgres has a file that defines WHO and HOW can connect.
> It is called pg_hba.conf
> Read the file!
> at the end you define who can connect.
> To make your postgres accept TCP/IP connections from the same machine
> add a line like:
> host all all 127.0.0.1 255.255.255.255 trust
>
> This is NOT SAFE, but will make sure you can connect. Don't use this on
> a productionserver or something serious..
>
> Hope this helps you out,
>
> Regards and good luck,
> Erwin
>



Re: Problem starting a session

From
Robert Treat
Date:
cat /path/to/database/postmaster.pid

the first line should be your process id.

ps -aux | grep "process id"

you should get something back like /usr/bin/postmaster, if you don't
your database is not running, you need to delete the file and stop/start
postgresql

Robert Treat

On Sat, 2003-02-01 at 19:05, news.verizon.net wrote:
> Erwin Moller,
>
> I made the configuration settings you mentioned in the thread below, but I'm
> still getting the same error message below. It seems that I've now setup the
> server to accept TCP/IP connections ans except connections/requests from all
> local users on my system, but I'm still getting the same error message.....
> I don't understand what's wrong because when I go into the 'services'  on my
> redhat linux 8 machine and restart the service postgresql, it restarts the
> server acceptionally - without any problems reported.... is their anything
> I'm missing that needs to be done to setup a user account and define the
> area where their database info and all is.... I've bought this book on
> postgre sql, but the book assumes you already have ther server setup to
> accept users.
>