Обсуждение: postgresql.conf listen_addresses causing connection problems

Поиск
Список
Период
Сортировка

postgresql.conf listen_addresses causing connection problems

От
"David Bernal"
Дата:
I recently have been attempting to get my install of postgresql 8.1
(running Win XP as OS) to listen on both 127.0.0.1 and my IP address,
192.168.0.100 (inside my network, obviously.) As such, I tried first
setting listen_addresses = '192.168.0.100, localhost'

With it like that, when I try to connect to the server using localhost
(I've tried this on a couple different clients) I get an error. If,
for example, I run psql -U user -d base, I get
"psql: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request."

Now, if I try again, this time with psql -h 192.168.0.100 -U user -d
base, it simply hangs, I don't even get a password prompt. Just for
fun, I let this sit for about 30 minutes, and it still did nothing. I
also checked the various logs I know of, and found nothing.

As a work around, I have tried setting
listen_addresses='192.168.0.100', however then I get an error about
half of the time, and it works normally half the time.

Setting listen_addresses='localhost' works just dandy, but then I
can't access the 'base except from home, and that's no good either.

Now, I did make some changes to my router recently, that I haven't
looked into yet, however, since this is all happening inside the
network, and mostly on the same machine as pgsql, I don't think that
would be it (correct me if I'm wrong.)

Any ideas? I'm fairly baffled, but then I'm a newbie.

Re: postgresql.conf listen_addresses causing connection problems

От
"Ian Harding"
Дата:
On 3/29/06, David Bernal <david.bernal@gmail.com> wrote:
> I recently have been attempting to get my install of postgresql 8.1
> (running Win XP as OS) to listen on both 127.0.0.1 and my IP address,
> 192.168.0.100 (inside my network, obviously.) As such, I tried first
> setting listen_addresses = '192.168.0.100, localhost'
>
Try * (wildcard) and see what happens.  It should either work or not
work, not work 'sometimes' so I think there must be something else
involved.  If pg_hba.conf is set up right, and listen address is *
then you have the network to look at.

Re: postgresql.conf listen_addresses causing connection problems

От
Tom Lane
Дата:
"David Bernal" <david.bernal@gmail.com> writes:
> I recently have been attempting to get my install of postgresql 8.1
> (running Win XP as OS) to listen on both 127.0.0.1 and my IP address,
> 192.168.0.100 (inside my network, obviously.) As such, I tried first
> setting listen_addresses = '192.168.0.100, localhost'

By "8.1" do you really mean "8.1.0"?  If so, you might try updating to
the latest subrelease (currently 8.1.3).  This problem doesn't offhand
seem to match any of the bug fixes I see in the CVS logs, but there have
been a number of Windows-specific fixes and maybe one of them explains
it.

> With it like that, when I try to connect to the server using localhost
> (I've tried this on a couple different clients) I get an error. If,
> for example, I run psql -U user -d base, I get
> "psql: server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>         before or while processing the request."

This should certainly leave some trace in the postmaster log file.
If you don't know where the log output is going, find out ;-)

            regards, tom lane

Re: postgresql.conf listen_addresses causing connection problems

От
Adrian Klaver
Дата:
On Wednesday 29 March 2006 02:59 am, David Bernal wrote:

>
> Any ideas? I'm fairly baffled, but then I'm a newbie.
>
Just a thought, did you restart the server after making the changes?
From the  Postgres docs-
"...This parameter can only be set at server start."

--
Adrian Klaver
aklaver@comcast.net

Re: postgresql.conf listen_addresses causing connection problems

От
"David Bernal"
Дата:
> Try * (wildcard) and see what happens.  It should either work or not
> work, not work 'sometimes' so I think there must be something else
> involved.  If pg_hba.conf is set up right, and listen address is *
> then you have the network to look at.

I actually also did try '*', and it actually did sometimes work and
sometimes not. Most of the time it wouldn't work, but occaisonally it
did.

Re: postgresql.conf listen_addresses causing connection problems

От
"David Bernal"
Дата:
> Just a thought, did you restart the server after making the changes?
> From the  Postgres docs-
> "...This parameter can only be set at server start."

Sure did, each and every time.

On 3/29/06, Adrian Klaver <aklaver@comcast.net> wrote:
> On Wednesday 29 March 2006 02:59 am, David Bernal wrote:
>
> >
> > Any ideas? I'm fairly baffled, but then I'm a newbie.
> >
> Just a thought, did you restart the server after making the changes?
> From the  Postgres docs-
> "...This parameter can only be set at server start."
>
> --
> Adrian Klaver
> aklaver@comcast.net
>

Re: postgresql.conf listen_addresses causing connection problems

От
"David Bernal"
Дата:
> By "8.1" do you really mean "8.1.0"?  If so, you might try updating to
> the latest subrelease (currently 8.1.3).  This problem doesn't offhand
> seem to match any of the bug fixes I see in the CVS logs, but there have
> been a number of Windows-specific fixes and maybe one of them explains
> it.
Yeah, sorry it is 8.1.0. If it comes to that, I will try the CVS
version, but I'm kind of leaning towards this being a network problem,
so I want to investigate that first.