Re: IPv4 addresses, unsigned integers, space

From: Jim Crate <jcrate(at)deepskytech(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: IPv4 addresses, unsigned integers, space
Date: 2003-07-16 23:55:36
Message-ID: r02000000-1026-FF198933B7E811D7A69D0003939CD378@[67.34.22.54]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

on 7/15/03, Florian Weimer <fw(at)deneb(dot)enyo(dot)de> wrote:

>If I switched from signed integers to unsigned integers (and from INET
>to "real" IPv4 addresses, consisting of the relevant 32 bits only) I
>think I could save about 25% of my table size.

Why do you need unsigned ints to hold IP addresses? Signed ints are also 32
bits wide and hold IPv4 addresses just fine. What difference does it make if IP
addresses with a class A higher than 127 appear as negative numbers?

Here's a couple of convenience function that convert between integer and dotted
notation. These functions work fine with the signed integers we have in
PostgreSQL.

<http://www.deepskytech.com/downloads/misc/ip_functions.txt>

--
Jim Crate
Deep Sky Technologies, Inc.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message James Moe 2003-07-16 23:58:22 Re: Anyone used pgHoster.com?
Previous Message Lynna Landstreet 2003-07-16 23:39:37 Unicode database question