Re: inet-type sequence - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: inet-type sequence
Date
Msg-id 20050129224122.GC14571@wolff.to
Whole thread Raw
In response to inet-type sequence  ("Andrey V. Semyonov" <wilfre@mail.ru>)
List pgsql-general
On Sat, Jan 29, 2005 at 22:24:46 +0300,
  "Andrey V. Semyonov" <wilfre@mail.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.

pgsql-general by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: Moving from Sybase to PostgreSQL - Stored Procedures
Next
From: William Yu
Date:
Subject: Re: Splitting queries across servers