Skip site navigation (1) Skip section navigation (2)

Re: strange problem with ip6

From: Christian Kratzer <ck-lists(at)cksoft(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>,Brian Hirt <bhirt(at)mobygames(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: strange problem with ip6
Date: 2007-05-17 16:42:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs

On Thu, 17 May 2007, Tom Lane wrote:

> Andrew Sullivan <ajs(at)crankycanuck(dot)ca> writes:
>> On Mon, May 14, 2007 at 08:32:21PM -0600, Brian Hirt wrote:
>>> I have postgresql installed on a mac, and I'm connecting from another
>>> mac on the network using ip6.   When I  try to select out of
>>> pg_stat_activity i get this error.  I suspect the %en0 has something
>>> to do with the problem, but I'm no IP6 expert.
>> That would indeed be a problem.  "%" is not a valid character in an
>> IPv6 text representation of the address (see RFC 4291,
>> <>).
>> Whether this is a bug for postgres seems to depend on whether that
>> reading is coming from the OS or postgres itself.
> I enabled IPv6 on my laptop (maybe I did it wrong, dunno) and noted that
> %en1 and %lo0 and similar notations were appended to some but not all of
> the IPv6 addresses output by "netstat -r -n".  Furthermore it seemed
> that adding or not adding these notations to IPv6 addresses given to
> psql's -h switch affected whether I could connect or not.  I didn't see
> a case where the %-thingy showed up in getnameinfo() output within
> Postgres, as is apparently happening for Brian; but it sure looked like
> it was happening to netstat.  So Apple is doing something mighty
> nonstandard here :-(.  I ran out of time/interest to probe deeper.

fe80:: addresses adre link local addresses and only valid in the context
of a specific interface. This is why bsd based oprating systems append 
%ifname to the address so that they know which Interface this address 
is on.

Windows seems to append %interfacenumber.  Not sure what linux does. 
Propably %ethN.

Check RFC4007 IPv6 Scoped Address Architecture for details.

There is propbaly not much point in using link local addreses for postgres.
You should have global ipv6 prefix on your interfaces to really make use 
of ipv6.


Christian Kratzer                      CK Software GmbH
Email:   ck(at)cksoft(dot)de                  Schwarzwaldstr. 31
Phone:   +49 7452 889 135              D-71131 Jettingen
Fax:     +49 7452 889 136              HRB 245288, Amtsgericht Stuttgart
Web:         Geschaeftsfuehrer: Christian Kratzer

In response to


pgsql-bugs by date

Next:From: Andrew SullivanDate: 2007-05-17 17:00:08
Subject: Re: strange problem with ip6
Previous:From: Stephan SzaboDate: 2007-05-17 16:15:10
Subject: Re: ON DELETE CASCADE with multiple paths

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group