postgresql-8.4-ip4r

Ipv4 and ipv4 range index types for postgresql 8.4
  http://pgfoundry.org/projects/ip4r/
  0
  no reviews



This postgresql module provides two data types, ip4 and ip4r, which can contain a single ipv4 address or a range of ipv4 addresses, respectively.

while postgresql already has built-in types 'inet' and 'cidr', the authors of this module found that they had a number of requirements that were not addressed by the built-in type.

firstly and most importantly, the built-in types have no support for index lookups of the form (column >>= parameter), i.e. where you have a table of ip address ranges and wish to find which ones include a given ip address. this requires an rtree or gist index to do efficiently, and also requires a way to represent ip address ranges that do not fall precisely on cidr boundaries.

secondly, the built-in inet/cidr are somewhat overloaded with semantics, with inet combining two distinct concepts (a netblock, and a specific ip within that netblock). furthermore, they are variable length types (to support ipv6) with non-trivial overheads, and the authors (whose applications mainly deal in large volumes of single ipv4 addresses) wanted a more lightweight representation.

ip4r therefore supports two distinct data types (so far):

ip4 - a single ipv4 address
ip4r - an arbitrary range of ipv4 addresses