Re: inet increment w/ int8

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: inet increment w/ int8
Дата
Msg-id
200504191649.j3JGn3Y27851@candle.pha.pa.us
Ответ на
Список
Дерево обсуждения
inet increment w/ int8 "Ilya A. Kovalenko" <shadow@oganer.net>
Re: inet increment w/ int8 "Ilya A. Kovalenko" <shadow@oganer.net>
Re: inet increment w/ int8 Bruce Momjian <pgman@candle.pha.pa.us>
Re: inet increment w/ int8 "Ilya A. Kovalenko" <shadow@oganer.net>
Re: inet increment w/ int8 Bruce Momjian <pgman@candle.pha.pa.us>
Re: inet increment w/ int8 Bruno Wolff III <bruno@wolff.to>
Re: inet increment w/ int8 Greg Stark <gsstark@mit.edu>
Re: inet increment w/ int8 Bruce Momjian <pgman@candle.pha.pa.us>
Re: inet increment w/ int8 "Ilya A. Kovalenko" <shadow@oganer.net>
Re: inet increment w/ int8 Greg Stark <gsstark@mit.edu>
Re: inet increment w/ int8 "Ilya A. Kovalenko" <shadow@oganer.net>
Re: inet increment w/ int8 Bruno Wolff III <bruno@wolff.to>
Re: inet increment w/ int8 Patrick Welche <prlw1@newn.cam.ac.uk>
Greg Stark wrote:
> 
> Bruce Momjian  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

So, do not overflow?  We can do that.  Another idea Tom had was creating
a function that increments/decrements the address or the network portion
of the address, and if you increment past the non-network portion that
overflows too.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610) 359-1001 +  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-hackers по дате отправления
От: Greg Stark
Дата:
Сообщение: Re: inet increment w/ int8
От: Alvaro Herrera
Дата:
Сообщение: Re: Problem with PITR recovery
FAQ