Re: inet subtraction fails with IPv6?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: inet subtraction fails with IPv6?
Дата
Msg-id 11082.1328045831@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: inet subtraction fails with IPv6?  (Jon Nelson <jnelson+pgsql@jamponi.net>)
Список pgsql-bugs
Jon Nelson <jnelson+pgsql@jamponi.net> writes:
> On Tue, Jan 31, 2012 at 2:03 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> What were you expecting to get? There's no such thing as a negative IP address.

> True, but it works for IPv4:

> jnelson=# select inet '255.255.255.255' - inet '0/0';
>   ?column?
> ------------
>  4294967295
> (1 row)

The inet minus inet operator is defined to yield bigint, so it only
copes for addresses within 2^63 of each other.  Short of inventing an
integer type at least 129 bits wide, the only way we could fix this is
to make the operator return numeric instead, which doesn't really seem
like an improvement for typical use-cases.  I'm fairly sure this was
debated when the operator was added, and we thought it was an acceptable
limitation; though maybe with IPv6 finally starting to see real usage
it's going to seem less so.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6200: standby bad memory allocations on SELECT
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fw: Re: [SQL] pg_dump not correctly saving schema with partitioned tables?