From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: exclusion constraint for ranges of IP
Date: 22 Aug 2011 11:37:24 GMT
Message-ID: <j2tf1k$b0u$1@reversiblemaps.ath.cx> (raw)
References: <CAF36091-203E-4C10-AA53-7D9087114D35@unicell.co.il>
On 2011-08-21, Herouth Maoz <herouth@unicell.co.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasen@xnet.co.nz
Subject: Re: exclusion constraint for ranges of IP
In-Reply-To: <j2tf1k$b0u$1@reversiblemaps.ath.cx>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox