Re: inet increment w/ int8

Bruno Wolff III <bruno@wolff.to>

From: Bruno Wolff III <bruno@wolff.to>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: "Ilya A. Kovalenko" <shadow@oganer.net>, Bruce Momjian <pgsql-hackers@postgresql.org>
Date: 2005-04-19T20:48:56Z
Lists: pgsql-hackers
On Tue, Apr 19, 2005 at 12:03:27 -0400,
  Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> 
> Agreed.  Let's implement '+/-' for 'inet + int4' and put it in the
> backend as standard (I can help do the system table stuff if you give me
> the C functions).  However, how do we handle cases where int4 > 255.  I
> 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 this operation makes much sense. Adding an integer makes
some sense, but I think the original problem would be better solved
by having a set returning function generate the possible network addresses
to be allocated and store that set in a table.

I don't think assuming everthing is a /24 is a good idea. If wrapping is
to be done, there should be some mask specified.