Re: Adding integers ( > 8 bytes) to an inet - Mailing list pgsql-general

From Tom Lane
Subject Re: Adding integers ( > 8 bytes) to an inet
Date
Msg-id 26970.1252424222@sss.pgh.pa.us
Whole thread Raw
In response to Re: Adding integers ( > 8 bytes) to an inet  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Adding integers ( > 8 bytes) to an inet  (Kristian Larsson <kristian@spritelink.net>)
List pgsql-general
Alvaro Herrera <alvherre@commandprompt.com> writes:
> I'd say this is just a missing feature.

I think the whole thing is a bit of a crock; adding integers to inet
addresses doesn't make a lot of sense logically.  Perhaps what is
really wanted is functions on CIDR net identifiers, for instance

    first_address('10/8') = 10.0.0.0
    last_address('10/8') = 10.255.255.255
    prior_address('10/8') = 9.255.255.255
    next_address('10/8') = 11.0.0.0

which would have obvious extensions to IPv6 without having to bring
numerics into the picture.

What are the actual applications for adding integers to inet addresses?
The one Kristian mentions seems to be covered by next_address(), but
are there others?

            regards, tom lane

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: How to store data on an external drive
Next
From: Kristian Larsson
Date:
Subject: Re: Adding integers ( > 8 bytes) to an inet