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

Re: BUG #5071: abbrev() bug with IPv6

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: alexander(dot)over(at)koeln(dot)de
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5071: abbrev() bug with IPv6
Date: 2009-09-28 02:21:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Tue, Sep 22, 2009 at 12:54 AM,  <alexander(dot)over(at)koeln(dot)de> wrote:
> The following bug has been logged online:
> Bug reference:      5071
> Logged by:
> Email address:      alexander(dot)over(at)koeln(dot)de
> PostgreSQL version: 8.3.7
> Operating system:   Debian Lenny 64Bit
> Description:        abbrev() bug with IPv6
> Details:
> I have a Database to store IPV6 addresses.
> Field "net" is type cidr.
> e.g.: '2001:400::/32' as value.
> "SELECT abbrev(net) FROM ipstore;"
> expected result: "2001:400::/32" (its already short v6)
> actual result: "2001:400/32" wich is invalid v6 Syntax.

I think this is the expected behavior.  The same thing happens with IPv4.

rhaas=# select abbrev(''::cidr);
(1 row)

It's also documented this way in the fine manual.

You can get the behavior you want by casting your cidr to an inet
before applying abbrev.


In response to

pgsql-bugs by date

Next:From: Robert HaasDate: 2009-09-28 02:23:52
Subject: Re: Databse installation problem
Previous:From: Robert HaasDate: 2009-09-28 02:18:30
Subject: Re: Encounter shared memory error when running createlang command!

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