pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpsql: could not connect to server: Network is unreachable
6+ messages / 3 participants
[nested] [flat]
* psql: could not connect to server: Network is unreachable
@ 2006-01-04 12:08 markos <el96645@mail.ntua.gr>
0 siblings, 2 replies; 6+ messages in thread
From: markos @ 2006-01-04 12:08 UTC (permalink / raw)
To: pgsql-admin
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
Now, I'm really confused because I used to have postgre 7 installed on
my Debian without any serious problems with the configuration. Right
now, I'm using Ubuntu Breezy and postgre 8.
I have used the sample .conf files to set my own
at /var/lib/postgres/data
the only two un-commented lines at the postgresql.conf are :
listen_addresses = 'localhost' # what IP interface(s) to listen on;
# defaults to localhost, '*' = any
port = 5432
And my pg_hba.conf is :
# TYPE DATABASE USER CIDR-ADDRESS METHOD
local all all trust
# The same using local loopback TCP/IP connections.
#
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
The command I issue to get this reply is :
psql -h localhost -U markulis
Also, I don't know if it is of any importance, but if I issue the
command while online, it simply hangs. I have also experienced the same
problem while trying to connect from pgadmin3.
I really need some help on this, because I have to present my diploma
work in short time and the system doesn't work.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: psql: could not connect to server: Network is unreachable
@ 2006-01-04 12:34 Pandurangan R S <pandurangan.r.s@gmail.com>
parent: markos <el96645@mail.ntua.gr>
1 sibling, 1 reply; 6+ messages in thread
From: Pandurangan R S @ 2006-01-04 12:34 UTC (permalink / raw)
To: markos <el96645@mail.ntua.gr>; +Cc: pgsql-admin
Hi,
can you check if postmaster is running on your machine using the
following command
ps -aef | grep postmaster
Also check check if postgres is listening on port 5432 using
netstat -na | grep ':5432'
On 1/4/06, markos <el96645@mail.ntua.gr> wrote:
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5432?
>
> Now, I'm really confused because I used to have postgre 7 installed on
> my Debian without any serious problems with the configuration. Right
> now, I'm using Ubuntu Breezy and postgre 8.
>
> I have used the sample .conf files to set my own
> at /var/lib/postgres/data
>
> the only two un-commented lines at the postgresql.conf are :
>
> listen_addresses = 'localhost' # what IP interface(s) to listen on;
> # defaults to localhost, '*' = any
> port = 5432
>
> And my pg_hba.conf is :
>
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
> local all all trust
> # The same using local loopback TCP/IP connections.
> #
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
> host all all 127.0.0.1/32 trust
> host all all ::1/128 trust
>
> The command I issue to get this reply is :
> psql -h localhost -U markulis
>
> Also, I don't know if it is of any importance, but if I issue the
> command while online, it simply hangs. I have also experienced the same
> problem while trying to connect from pgadmin3.
>
> I really need some help on this, because I have to present my diploma
> work in short time and the system doesn't work.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: psql: could not connect to server: Network is unreachable
@ 2006-01-04 15:29 Tom Lane <tgl@sss.pgh.pa.us>
parent: markos <el96645@mail.ntua.gr>
1 sibling, 0 replies; 6+ messages in thread
From: Tom Lane @ 2006-01-04 15:29 UTC (permalink / raw)
To: markos <el96645@mail.ntua.gr>; +Cc: pgsql-admin
markos <el96645@mail.ntua.gr> writes:
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5432?
Please show the *entire* error message, not just the part you think
is important.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: psql: could not connect to server: Network is
@ 2006-01-04 17:34 markos <el96645@mail.ntua.gr>
parent: Pandurangan R S <pandurangan.r.s@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: markos @ 2006-01-04 17:34 UTC (permalink / raw)
To: pgsql-admin
First of all, thanks for the swift replies.
The whole error message is actually this :
psql -h localhost -U markulis
psql: could not connect to server: Network is unreachable
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
the result of :
ps -aef | grep postmaster
is
postgres 8702 1 0 19:08 pts/1
00:00:00 /usr/lib/postgresql/8.0/bin/postmaster
-D /var/lib/postgresql/8.0/main -c
unix_socket_directory=/var/run/postgresql -c
config_file=/etc/postgresql/8.0/main/postgresql.conf -c
hba_file=/etc/postgresql/8.0/main/pg_hba.conf -c
ident_file=/etc/postgresql/8.0/main/pg_ident.conf
root 8811 8560 0 19:17 pts/1 00:00:00 grep postmaster
what I realized from this is that postmaster uses diferrent .conf files
than what I thought. Yet, I changed them too and nothing happened.
(The postgresql.conf on this directory had
listen_addresses = 'localhost'
commented out, but the default is localhost anyway)
the result of :
netstat -na | grep ':5432'
is nothing
I suppose that this suggests postmaster is not listening to port 5432.
But both postgresql.conf that I have on my system have the line
port = 5432
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: psql: could not connect to server: Network is
@ 2006-01-04 17:51 Tom Lane <tgl@sss.pgh.pa.us>
parent: markos <el96645@mail.ntua.gr>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2006-01-04 17:51 UTC (permalink / raw)
To: markos <el96645@mail.ntua.gr>; +Cc: pgsql-admin
markos <el96645@mail.ntua.gr> writes:
> psql -h localhost -U markulis
> psql: could not connect to server: Network is unreachable
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5432?
Hm. "Network is unreachable" means that you have got a networking
problem not a database problem. You'll probably find that simple
commands like "ping localhost" don't work either. The problem could
be a DNS issue --- what does "nslookup localhost" say? If it comes
back with something reasonable, then you've got a kernel
misconfiguration issue, which I don't think I can help you with.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: psql: could not connect to server: Network is
@ 2006-01-05 01:26 markos <el96645@mail.ntua.gr>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: markos @ 2006-01-05 01:26 UTC (permalink / raw)
To: pgsql-admin
On Wed, 2006-01-04 at 12:51 -0500, Tom Lane wrote:
> markos <el96645@mail.ntua.gr> writes:
> > psql -h localhost -U markulis
> > psql: could not connect to server: Network is unreachable
> > Is the server running on host "localhost" and accepting
> > TCP/IP connections on port 5432?
>
> Hm. "Network is unreachable" means that you have got a networking
> problem not a database problem. You'll probably find that simple
> commands like "ping localhost" don't work either. The problem could
> be a DNS issue --- what does "nslookup localhost" say? If it comes
> back with something reasonable, then you've got a kernel
> misconfiguration issue, which I don't think I can help you with.
>
> regards, tom lane
Thanks a lot. You were actually right, the network was down. I just had
to give the command : "sudo ifup lo". I just couldn't narrow my search
until you made sure that postgre is ok, so thanks again
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2006-01-05 01:26 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-04 12:08 psql: could not connect to server: Network is unreachable markos <el96645@mail.ntua.gr>
2006-01-04 12:34 ` Pandurangan R S <pandurangan.r.s@gmail.com>
2006-01-04 17:34 ` Re: psql: could not connect to server: Network is markos <el96645@mail.ntua.gr>
2006-01-04 17:51 ` Re: psql: could not connect to server: Network is Tom Lane <tgl@sss.pgh.pa.us>
2006-01-05 01:26 ` Re: psql: could not connect to server: Network is markos <el96645@mail.ntua.gr>
2006-01-04 15:29 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox