Re: Adding integers ( > 8 bytes) to an inet

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Adding integers ( > 8 bytes) to an inet
Date: 2009-09-08 16:11:02
Message-ID: 20090908161102.GJ5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Sep 08, 2009 at 05:58:01PM +0200, Kristian Larsson wrote:
> On Tue, Sep 08, 2009 at 11:37:02AM -0400, Tom Lane wrote:
> > 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
[...]
> For me, as a network engineer, adding an integer to a inet feels
> quite natural. Inet is just another representation of a integer
> anyway... so I'd really not have a problem with having either a
> int16 or being able to add numerics to inets :)

Indeed, it seems similar to the (somewhat arbitrary) decision that
adding an int to a date results that many days being added to it.
Timestamp INTERVALs may be more flexible, but it's a useful shortcut
that I use quite often.

Something to convert to/from a NUMERIC value and INET would seem useful
as well.

--
Sam http://samason.me.uk/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2009-09-08 16:29:07 pg_dump exists without any message when running from windows task scheduler
Previous Message Kristian Larsson 2009-09-08 16:04:34 Re: Adding integers ( > 8 bytes) to an inet

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-09-08 16:11:55 Re: Patch: update Bonjour support to the newer non-deprecated API
Previous Message Michael Gould 2009-09-08 16:09:35 Disable and enable of table and column constraints