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-10 15:51:16
Message-ID: 20090910155116.GO5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Sep 10, 2009 at 10:30:49AM -0400, Tom Lane wrote:
> Kristian Larsson <kristian(at)spritelink(dot)net> writes:
> > Do we
> > c) add a conversation between NUMERIC and INET so one can add a
> > NUMERIC to an INET just as is possible today with INTEGERs?
>
> Proposal (c) is disingenuous because it ignores the fact that NUMERIC
> does not have (and cannot easily implement) most of the bitwise
> operations that people might think they want here.

Huh, good point. What you want is a finite field; which looks exactly
like what the "bit" type is for. Why not use that?

You can't cast them to or from numeric which is a bit annoying, but
doesn't seem too hard in principle.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2009-09-10 16:18:59 Re: array datatype supported by Perl DBI with Postgres DBD ?
Previous Message Richard Huxton 2009-09-10 15:09:17 Re: "show all" command crashes server

Browse pgsql-hackers by date

  From Date Subject
Next Message Emmanuel Cecchet 2009-09-10 16:06:36 Re: COPY enhancements
Previous Message Tom Lane 2009-09-10 15:50:24 Re: new version of PQconnectdb was:(Re: [HACKERS] Determining client_encoding from client locale)