Re: exclusion constraint for ranges of IP

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: exclusion constraint for ranges of IP
Date: 2011-08-22 11:37:24
Message-ID: j2tf1k$b0u$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2011-08-21, Herouth Maoz <herouth(at)unicell(dot)co(dot)il> wrote:
> Hi,
>
> I'm designing a new database. One of the table contains allowed IP ranges for a customer (Fields: customer_id, from_ip, to_ip) which is intended to check - if an incoming connection's originating IP number falls within the range, it is identified as a particular customer.
>
> Naturally, I'd like to have constraints on the table that prevent entering of ip ranges that overlap. Is there a way to do that with exclusion constraints? Or do I have to define a new type for this?
>
> Herouth

if you can use CIDR instead of ranges it should be relatively simple

--
⚂⚃ 100% natural

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Misa Simic 2011-08-22 13:07:50 Re: exclusion constraint for ranges of IP
Previous Message Simone Sanfratello 2011-08-22 09:27:14 Re: exclusion constraint for ranges of IP