Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 55BEA650070 for ; Mon, 8 Sep 2008 11:15:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29446-09 for ; Mon, 8 Sep 2008 11:15:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from coe.tamu.edu (edsun.coe.tamu.edu [165.91.232.6]) by postgresql.org (Postfix) with ESMTP id CB43464FD14 for ; Mon, 8 Sep 2008 11:15:10 -0300 (ADT) Received: from coe.tamu.edu (coe.tamu.edu [165.91.232.6]) by coe.tamu.edu (8.11.7p3+Sun/8.12.11) with ESMTP id m88EF7F11404; Mon, 8 Sep 2008 09:15:07 -0500 (CDT) Date: Mon, 8 Sep 2008 09:15:07 -0500 (CDT) From: Ben Kim To: Alvaro Herrera cc: "Sofer, Yuval" , pgsql-admin@postgresql.org, "Abraham, Danny" Subject: Re: problem with pg_stat_activity view In-Reply-To: <20080908134439.GB4411@alvh.no-ip.org> Message-ID: References: <20080908134439.GB4411@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/69 X-Sequence-Number: 30162 That explains it... I thought it was a precent encoding but at the same time a strange place for a control character. Regards, Ben Kim On Mon, 8 Sep 2008, Alvaro Herrera wrote: > >>> 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 > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin >