Re: inet-type sequence

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Andrey V(dot) Semyonov" <wilfre(at)mail(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: inet-type sequence
Date: 2005-01-29 22:41:22
Message-ID: 20050129224122.GC14571@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jan 29, 2005 at 22:24:46 +0300,
"Andrey V. Semyonov" <wilfre(at)mail(dot)ru> wrote:
> Hi there.
> How do I create a sequence of type inet for automatic assignment an
> IP/32 to a new row?
> Neither nextval() nor CREATE SEQUENCE seem for me to work with type inet
> (PostgreSQL 8.0.0, pgAdmin III v 1.2.0).

Unless you have a huge net block, you probably don't want to use a sequence
like object anyway. You are going to want some way to reuse previous IP
addresses that have been released.

Having a table of usable IP addresses with a flag indicating which are in
use might be a practical solution for you if the block(s) of addresses
isn't too big.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-01-29 23:11:58 Re: Splitting queries across servers
Previous Message William Yu 2005-01-29 22:36:31 Re: Splitting queries across servers