Thread: Error_startup postgresql server

Error_startup postgresql server

From
Joana Camacho
Date:
Hi,

I'm using Postgresql 8.7.3 on Debian. I was trying to launch the postgresql server to create a simple user and a database, but I've got this output:

--------------------------------------------------------------------------------------------------------------
jc:/usr/local/pgsql/data1# su - postgres
postgres@jc:~$ /usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgsql/data1/data/
server starting
postgres@jc:~$ /usr/local/pgsql/bin/createuser radius --no-superuser --no-createdb --no-createrole -P
Enter password for new role:
Enter it again:
createuser: could not connect to database postgres: 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"?
--------------------------------------------------------------------------------------------------------------

I've search the web and seen some people saying to uncomment a line in the postgresql.conf file ("tcpip_socket = true") but I don't have this line! I'm not understanding what's wrong, why can't I create an user, supposedly the server is running..

Can someone tell me what am I doing wrong?

Thank you,
Joana Camacho.

Re: Error_startup postgresql server

From
Raymond O'Donnell
Date:
On 07/12/2009 13:54, Joana Camacho wrote:
> Hi,
>
> I'm using Postgresql 8.7.3 on Debian. I was trying to launch the postgresql
> server to create a simple user and a database, but I've got this output:
>
> --------------------------------------------------------------------------------------------------------------
> jc:/usr/local/pgsql/data1# su - postgres
> postgres@jc:~$ /usr/local/pgsql/bin/pg_ctl start -l logfile -D
> /usr/local/pgsql/data1/data/
> server starting
> postgres@jc:~$ /usr/local/pgsql/bin/createuser radius --no-superuser
> --no-createdb --no-createrole -P
> Enter password for new role:
> Enter it again:
> createuser: could not connect to database postgres: 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"?
> --------------------------------------------------------------------------------------------------------------
>
> I've search the web and seen some people saying to uncomment a line in the
> postgresql.conf file ("tcpip_socket = true") but I don't have this line! I'm
> not understanding what's wrong, why can't I create an user, supposedly the
> server is running..

I think that should be

    listen_addresses = *

By default the server listens only on local Unix sockets - you have to
uncomment the above line to have it listen on a TCP/IP address/port.
Setting the option to "*" has it listen on port 5432 (the default port)
on all available addresses; you can restrict it to a specific address or
addresses by specifying them on this line.


Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: Error_startup postgresql server

From
"Daniel Verite"
Date:
    Joana Camacho wrote:

> postgres@jc:~$ /usr/local/pgsql/bin/pg_ctl start -l logfile -D
> /usr/local/pgsql/data1/data/
> server starting
> postgres@jc:~$ /usr/local/pgsql/bin/createuser radius --no-superuser
> --no-createdb --no-createrole -P
> Enter password for new role:
> Enter it again:
> createuser: could not connect to database postgres: 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"?
> --------------------------------------------------------------------------------------------------------------
>
> I've search the web and seen some people saying to uncomment a line in the
> postgresql.conf file ("tcpip_socket = true") but I don't have this line! I'm
> not understanding what's wrong, why can't I create an user, supposedly the
> server is running..

tcpip_socket is for older versions, but according to the error message, the
createuser program doesn't try to connect to a TCP/IP socket so whether there
is one or not is not relevant to your immediate problem.

Maybe the postgresql server fails to start, first you want to look for errors
in 'logfile' (your -l option to pg_ctl start) about that.

Othewise you sould follow the lead of the error message and check things such
as if /tmp/.s.PGSQL.5432 exists, what are its permissions, if it doesn't
exist what is the value of the unix_socket_directory parameter in
postgresql.conf, or what port postgres is configured to listen to (also in
postgresql.conf).
If they're non-standard you need pass additional options to the createuser
command.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

Re: Error_startup postgresql server

From
Tom Lane
Date:
Joana Camacho <joanacmch@gmail.com> writes:
> I'm using Postgresql 8.7.3 on Debian. I was trying to launch the postgresql
> server to create a simple user and a database, but I've got this output:

Did you look into the postmaster logfile?  It's not clear from this if
it failed to start (if so it should have put a message in the logfile)
or if it started but is not listening where createuser expects the
socket to be.  createuser says it expects it at "/tmp/.s.PGSQL.5432"
which is the standard place on most platforms; but I think Debian
prefers something under /var/run, so you could be running into a problem
of having partially absorbed some Debian preferences.

You could also try using ps to confirm whether the postmaster is running
and if so use lsof on it to see where its socket is.

            regards, tom lane