pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Ben Kim <bkim@tamu.edu>
Cc: Sofer, Yuval <Yuval_Sofer@bmc.com>
Cc: pgsql-admin@postgresql.org
Cc: Abraham, Danny <danny_abraham@bmc.com>
Subject: Re: problem with pg_stat_activity view
Date: Mon, 8 Sep 2008 09:44:39 -0400
Message-ID: <20080908134439.GB4411@alvh.no-ip.org> (raw)
In-Reply-To: <Pine.GSO.4.64.0809080824320.9078@coe.tamu.edu>
References: <BE67D1149BBD5746984545ED91F702E001F43035@hou-ex-02.adprod.bmc.com>
	<Pine.GSO.4.64.0809080824320.9078@coe.tamu.edu>


>> ERROR:  invalid input syntax for type inet:
>> "fe80::104d:416e:a8dc:c02e%12"
>>
>> SQL state: 22P02

Interesting.

When we HAVE_IPV6, there's code to remove stuff after a % in an address.
My bet is that what you're running was not compiled with HAVE_IPV6 and
so the code is not executed.  Obviously this is invoked in
pg_stat_get_backend_client_addr().

/*      
 * clean_ipv6_addr --- remove any '%zone' part from an IPv6 address string
 *      
 * XXX This should go away someday!
 *
 * This is a kluge needed because we don't yet support zones in stored inet
 * values.  Since the result of getnameinfo() might include a zone spec,
 * call this to remove it anywhere we want to feed getnameinfo's output to
 * network_in.  Beats failing entirely.
 *
 * An alternative approach would be to let network_in ignore %-parts for
 * itself, but that would mean we'd silently drop zone specs in user input,
 * which seems not such a good idea.
 */
void
clean_ipv6_addr(int addr_family, char *addr)
{
#ifdef HAVE_IPV6
    if (addr_family == AF_INET6)
    {
        char       *pct = strchr(addr, '%');

        if (pct)
            *pct = '\0';
    }
#endif
}

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (6+ messages)  latest in thread

Message-ID: <20080908134439.GB4411@alvh.no-ip.org>
Permalink:  ../20080908134439.GB4411@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20080908134439.GB4411@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: alvherre@commandprompt.com, bkim@tamu.edu, Yuval_Sofer@bmc.com, danny_abraham@bmc.com
  Subject: Re: problem with pg_stat_activity view
  In-Reply-To: <20080908134439.GB4411@alvh.no-ip.org>
  References: <BE67D1149BBD5746984545ED91F702E001F43035@hou-ex-02.adprod.bmc.com> <Pine.GSO.4.64.0809080824320.9078@coe.tamu.edu> <20080908134439.GB4411@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox