PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby Eky1968 » Mon Mar 16, 2009 1:50 pm

I am having exactly the same problems as PeteX, and I'm running the same programs, Vista Ultimate 64 bit, Windows firewall and Avast, all with latest updates.

There was a .NET SP1 update 15/3-2009.

The last time I'm sure it worked was 9/3-2009.

I have tried to stop Avast as well, but it don't help.
Eky1968
 
Posts: 35
Joined: Tue Apr 01, 2008 4:10 am

RESOLVED!

Postby PeteX » Mon Mar 16, 2009 2:59 pm

Ok, I found the problem!!!

I decided to check first if there is someone listening to port 5432 and did this:
C:\>netstat -na

Active Connections

Proto Local Address Foreign Address State
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
... (clip)...
TCP [::1]:5432 [::]:0 LISTENING
....
Hold on, what's this [::1]:5432??? Ah, it's a bloody IPv6 localhost! So, for some reason PostgreSQL is binding itself to the IPv6 localhost! So, let's see what ping says:

C:\>ping localhost

Pinging PeteXComp [::1] from ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Woot?!? I'm used to seeing 127.0.0.1 there and not ::1. So why is "localhost" mapping to ::1?

Well, have a peek at the c:\windows\system32\drivers\etc\hosts file and whats in there:
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

::1 localhost

So, some bugger has mapped ::1 to "localhost" without me knowing it... Windows update or what, who knows?

Anyways, adding a # on front of ::1 (or changing ::1 to 127.0.0.1, I guess as well) fixed the thing! Just logged out and back in and sure enough, netstat -an says now:
...
TCP 127.0.0.1:5432 0.0.0.0:0 LISTENING
...

There you go!!!

Now pgAdmin III is working again like a charm!
PeteX
 
Posts: 194
Joined: Sat Apr 05, 2008 9:12 am

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby kraada » Mon Mar 16, 2009 3:27 pm

::1 is the IPv6 way of saying 127.0.0.1; I'm not sure how IPv6 got half turned on on your machine, but you should have just been able to add 127.0.0.1 to the end of pg_hba.conf, you shouldn't actually need to remove ::1, not that it matters if things are working for you now.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby PeteX » Tue Mar 17, 2009 3:39 am

kraada wrote:::1 is the IPv6 way of saying 127.0.0.1; I'm not sure how IPv6 got half turned on on your machine, but you should have just been able to add 127.0.0.1 to the end of pg_hba.conf, you shouldn't actually need to remove ::1, not that it matters if things are working for you now.

Yep, that's quite strange. I remember definitely having only seen 127.0.0.1 always when dealing with the localhost in any context; I have not touched pg_hbd.conf in anyway, it's very strange that PostgreSQL just decided to only "be visible" from ::1 port 5432 and not 127.0.0.1:5432, as you can see from the netstat output. For some reason that was good enough for PT3 and for my proggies, but pgAdmin couldn't connect it there.

Anyways, this is a good tidbit for the good-2-know-department.

Weird are the ways of windows... ;)
PeteX
 
Posts: 194
Joined: Sat Apr 05, 2008 9:12 am

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby kraada » Tue Mar 17, 2009 10:11 am

Definitely strange and I will certainly keep it in mind should anybody else have the same problem in the future and post about it on here.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby Eky1968 » Tue Mar 17, 2009 1:20 pm

Thank you.

I tried to change the host file to 127.0.0.1 localhost, and it solved the problem.

If I do the netstat I see the following lines
TCP 127.0.0.1:5432 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5432 127.0.0.1:49465 ESTABLISHED
TCP [::1]:5432 [::]:0 LISTENING
Eky1968
 
Posts: 35
Joined: Tue Apr 01, 2008 4:10 am

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby pokerrow » Sun Mar 22, 2009 5:37 pm

Very interesting...I remember recently seeing something from either McAfee or Windows Defender about something going on with the hosts file, and I let it take corrective action. Pete, thanks for debugging!
pokerrow
 
Posts: 97
Joined: Thu Jan 24, 2008 8:56 pm

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby ikdb99 » Wed Jun 10, 2009 5:15 pm

Ok, i'm having the same problem. Can somebody explain me in n00b language how to change it??

thanks in advance!
ikdb99
 
Posts: 1
Joined: Mon Jun 09, 2008 10:43 am

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby kraada » Wed Jun 10, 2009 5:21 pm

Edit the hosts file per this post and make sure that it contains these lines:
127.0.0.1 localhost
::1 localhost
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL 8.3.4 problems with pgAdmin + upgrade; Vista

Postby Kingsclicker » Tue Jun 16, 2009 4:03 pm

So... the final one should look like this? (This isn't working for me)

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# 127.0.0.1 localhost
Kingsclicker
 
Posts: 8
Joined: Mon Jun 15, 2009 2:44 pm

PreviousNext

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 6 guests