Re: inet increment w/ int8

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: inet increment w/ int8
Date: 2005-04-19 16:41:34
Message-ID: 87d5sqk9c1.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:

> am thinking we should support only inet + inet, like this:
>
> SELECT '1.2.3.4'::inet + '0.0.1.2'::inet;

I don't think inet+inet makes any sense.

I think inet+int4 should work by adding to the host address and overflowing if
it exceeds the network mask.

Ie,

10.0.0.0/24 + 1 = 10.0.0.1/24
10.0.0.255/24 + 1 => overflow

Or

10.1/16 + 1 = 10.1.0.1/16
10.1/16 + 16384 = 10.1.64.0/16
10.1/16 + 65536 => overflow

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-04-19 16:49:03 Re: inet increment w/ int8
Previous Message Tom Lane 2005-04-19 16:20:51 Re: Problem with PITR recovery