Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could not connect to server...

Status
Not open for further replies.
May 7, 2007
3
IT
Hi,
I write from Italy, so sorry for my not-so-good English.

Yesterday I installed postgreSQL on my Ubuntu machine. At first I installed it (8.2 version) from the repositories, but then I found a developer's site where I discovered that compiling it from source is probably the best thing to do.
So I removed the version I previously installed and compiled the sources I downloaded from the official site.
Compiling didn't show any problem, but at the end of the process I didn't know how to start the postgres daemon and so on, so I decided to remove the version I compiled and install again with repos.

The installation seemed to end without warnings, but now, when I try to run "psql", I obtain this error message:

psql: could not connect to server: No file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/
postgresql/.s.PGSQL.5432"?

So it seems that the server is not up and running, but the question is: HOW can I make it run???

Thanks in advance for every answer :)

MarKco
 
as most of the services in ubuntu you start it with

/etc/init.d/postgres start
 
Uhm... I did it, but the answer is the same.
Probably the problem is not in the not-running daemon (which now is running) but in something else.

I noticed that the file /var/run/postgresql/.s.PGSQL.5432 does not exist.
Probably this is THE problem... but how can I create it?

MarKco
 
this file exists when the standard version the one that comes with ubuntu is started, are you sure you see it in the process list

actually, on ubuntu the start script is /etc/init.d/postgresql-8.2
 
Uhm... at the moment I haven't got time to read all the instruction lines contained in pg_hba.conf, but if I figure well the part of the file you're referring to is this:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

Here it seems to be allowed every kind of connection...
 
Hi

Right, there you have everything allowed for localhost. But my other question still stands. The important to know would be if you specify [tt]-h localhost[/tt] in [tt]psql[/tt]'s parameters or not. Because there is a difference. If I remember correctly, if you do not specify it, the connection relies on a block (?) special file. Which is created when the server starts, but of course only if the user who runs it has permission to create it. If this is the situation, you could still connect by specifying the [tt]-h[/tt] parameter.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top