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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: BUG #5071: abbrev() bug with IPv6
Дата
Msg-id 603c8f070909271921n3f30b603le5949dc6f81f807f@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #5071: abbrev() bug with IPv6  ("" <alexander.over@koeln.de>)
Список pgsql-bugs
On Tue, Sep 22, 2009 at 12:54 AM,  <alexander.over@koeln.de> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =A0 =A0 =A05071
> Logged by:
> Email address: =A0 =A0 =A0alexander.over@koeln.de
> PostgreSQL version: 8.3.7
> Operating system: =A0 Debian Lenny 64Bit
> Description: =A0 =A0 =A0 =A0abbrev() 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=3D# select abbrev('216.83.114.0/24'::cidr);
    abbrev
---------------
 216.83.114/24
(1 row)

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

http://www.postgresql.org/docs/current/static/functions-net.html#CIDR-INET-=
FUNCTIONS-TABLE

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

...Robert

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Encounter shared memory error when running createlang command!
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Databse installation problem