Re: listen_addresses = '*' ok, specific address(es) no (.... and a thread hi-jack!) - Mailing list pgsql-sql

From Phillip Smith
Subject Re: listen_addresses = '*' ok, specific address(es) no (.... and a thread hi-jack!)
Date
Msg-id 005301c690ef$75a5ee30$9b0014ac@ITPhil
Whole thread Raw
In response to Re: listen_addresses = '*' ok, specific address(es) no  (Geoffrey Knauth <geoff@knauth.org>)
Responses Re: listen_addresses = '*' ok, specific address(es) no (.... and a thread hi-jack!)
List pgsql-sql
Hi Geoff,

Listen_addresses means what local interface to listen to connections - ie,
if you have 2 network interfaces (cards) in the machine that go to 2
different networks - such as one to the internet and one to your LAN, you
could tell Postgres to only listen on the LAN interface for connections so
it won't accept connections from anything on the internet. What you're after
would be better done by a firewall (ipchains / iptables)

<HIJACK>
I've just installed Postgres 8.1 on RedHat 7.1 and I'm getting the error:
"2006-06-16 14:49:00 NZST @ []LOG:  could not create IPv6 socket: Address
family not supported by protocol"

RedHat 7.1 does not support IPv6, but I don't need it - how can I disable
it? I've set my listen_addresses to:listen_addresses = '172.23.0.1'

Yes, I do have a local address 172.23.0.1 as per output from ifconfig:
[postgres@wbnz pgsql]$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:20:ED:38:EB:F4         inet addr:172.23.0.1  Bcast:172.23.255.255
Mask:255.255.0.0        UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1         RX packets:2548578 errors:0
dropped:0overruns:0 frame:0         TX packets:2479774 errors:0 dropped:0 overruns:1 carrier:0         collisions:0
txqueuelen:100        Interrupt:18 Base address:0xe000 Memory:e0998000-e0998c40 

</HIJACK>

Cheers,
-p


-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of Geoffrey Knauth
Sent: Friday, 16 June 2006 12:06 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] listen_addresses = '*' ok, specific address(es) no

Tom,

I omitted the LOG and HINT lines before.

LOG:  could not bind IPv4 socket: Can't assign requested address
HINT:  Is another postmaster already running on port 5432? If not,
wait a few seconds and retry.
WARNING:  could not create listen socket for "192.168.1.33"
FATAL:  could not create any TCP/IP sockets

This works fine if I use '*' instead of '192.168.1.33'.

Andrew Sullivan wrote:
> Well, do you actually have an interface with that address?

I think I do, in that the machine's wireless interface is set up with
a 192.168.1.x/24 address and 1.33 is on the same subnet.  Or maybe
I'm misunderstanding.  I thought the purpose of listen_addresses was
to allowing incoming connections only from listed addresses.

Geoff

On Jun 15, 2006, at 10:40, Tom Lane wrote:

> Geoffrey Knauth <geoff@knauth.org> writes:
>> I'm running PostgreSQL 8.1.3.  In my postgresql.conf, the following
>> works:
>>     listen_addresses = '*'
>
>> but the following does not:
>>     listen_addresses = '192.168.1.33'
>
>> I get an error:
>>     WARNING:  could not create listen socket for "192.168.1.33"
>>     FATAL:  could not create any TCP/IP sockets
>
> There should be more info than that --- AFAICS all the failure
> paths in
> that code emit LOG messages.  Perhaps you have log_min_messages set
> too
> high to allow the info to come out?

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee.  If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: listen_addresses = '*' ok, specific address(es) no
Next
From: "Phillip Smith"
Date:
Subject: Re: listen_addresses = '*' ok, specific address(es) no