Thread: Client connection: Port 5432 / Postgres

Client connection: Port 5432 / Postgres

From
"Nicolas Gignac"
Date:
Hello,

I have installed Postgres 8.2 on a internal server having Windows Server 2003 (IIS 6) up and running.
- I have configure the hp_config file to: host                    all                             0.0.0.0./0                                md5
- I have change the listening address to '*' in the postgres.conf file
- No Firewall activated on this internal server
- I have restart the server and I can connect to postgres from remote computer, PostgreSQL works only from the local host
- When I do a Netstat I got this: TCP           127.0.0.0.1:5432                            0.0.0.0.0                          LISTENING              440
- When I tried to connect from local host to the port with telnet localhost 5432, I got an error: on port 23, connect failed.

What are the options/ways to allow connection by PostgreSQL remote Clients to the 5432 port on my server in this internal network? Or is there any problem with my steps, something I missed?

Thanks for your help.

Nicolas Gignac

Re: Client connection: Port 5432 / Postgres

From
"A. Kretschmer"
Date:
am  Wed, dem 07.02.2007, um 11:28:56 -0500 mailte Nicolas Gignac folgendes:
> Hello,
>
> I have installed Postgres 8.2 on a internal server having Windows Server 2003
> (IIS 6) up and running.
> - I have configure the hp_config file to: host
> all                             0.0.0.0./0                                md5

wrong file. Use pg_hba.conf instead.

> - I have change the listening address to '*' in the postgres.conf file

wrong file. Use postgresql.conf instead.


> - No Firewall activated on this internal server

Sure?


> - I have restart the server and I can connect to postgres from remote computer,
> PostgreSQL works only from the local host

You can or you can't connect from remote?


> - When I tried to connect from local host to the port with telnet localhost
> 5432, I got an error: on port 23, connect failed.

Stupid windows. Perhaps a Port-Forwarding? A plain 'telnet localhost 5432'
should do a connect to this port, not to 23.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: Client connection: Port 5432 / Postgres

From
Richard Huxton
Date:
Nicolas Gignac wrote:
> Hello,
>
> I have installed Postgres 8.2 on a internal server having Windows Server
> 2003 (IIS 6) up and running.
> - I have configure the hp_config file to: host
> all                             0.0.0.0./0
> md5

Don't you mean pg_hba.conf?

> - I have change the listening address to '*' in the postgres.conf file
> - No Firewall activated on this internal server
> - I have restart the server and I can connect to postgres from remote
> computer, PostgreSQL works only from the local host
> - When I do a Netstat I got this: TCP           127.0.0.0.1:5432
> 0.0.0.0.0                          LISTENING              440

It's either not re-read the postgresql.conf file or there is a syntax
error in the file. Otherwise you'd see it listening. What do the logs
say when you restart PostgreSQL?

> - When I tried to connect from local host to the port with telnet localhost
> 5432, I got an error: on port 23, connect failed.

That looks like you're trying to connect to port 23.

--
   Richard Huxton
   Archonet Ltd

Re: Client connection: Port 5432 / Postgres

From
Mikko Partio
Date:
Nicolas Gignac wrote:
> I have installed Postgres 8.2 on a internal server having Windows
> Server 2003 (IIS 6) up and running.
> - I have configure the hp_config file to: host
> all
> 0.0.0.0./0                                md5
>            ^

I think it should be like:

host   all   all   0.0.0.0/0   md5


MP

Re: Client connection: Port 5432 / Postgres

From
Tom Lane
Date:
"Nicolas Gignac" <gignacnic@gmail.com> writes:
> I have installed Postgres 8.2 on a internal server having Windows Server
> 2003 (IIS 6) up and running.
> - I have configure the hp_config file to: host
> all                             0.0.0.0./0
> md5
> - I have change the listening address to '*' in the postgres.conf file
> - No Firewall activated on this internal server
> - I have restart the server and I can connect to postgres from remote
> computer, PostgreSQL works only from the local host
> - When I do a Netstat I got this: TCP           127.0.0.0.1:5432
> 0.0.0.0.0                          LISTENING              440

I'm pretty sure the above entry is only listening for local connections
--- I think there should be a netstat entry showing your machine's real
IP address and port 5432.  Since there's not, you probably didn't change
listen_addresses correctly; maybe you forgot to uncomment the
postgresql.conf line, or edited the wrong copy of the file, or didn't
really restart the server.

            regards, tom lane

Re: Client connection: Port 5432 / Postgres

From
"Nicolas Gignac"
Date:
Thanks. Finally, I discovered one line not uncomment, stupid typos error.

Nicolas

2007/2/7, Nicolas Gignac <gignacnic@gmail.com>:
Hello,

I have installed Postgres 8.2 on a internal server having Windows Server 2003 (IIS 6) up and running.
- I have configure the hp_config file to: host                    all                             0.0.0.0./0                                md5
- I have change the listening address to '*' in the postgres.conf file
- No Firewall activated on this internal server
- I have restart the server and I can connect to postgres from remote computer, PostgreSQL works only from the local host
- When I do a Netstat I got this: TCP           127.0.0.0.1:5432                            0.0.0.0.0                          LISTENING              440
- When I tried to connect from local host to the port with telnet localhost 5432, I got an error: on port 23, connect failed.

What are the options/ways to allow connection by PostgreSQL remote Clients to the 5432 port on my server in this internal network? Or is there any problem with my steps, something I missed?

Thanks for your help.

Nicolas Gignac