Re: inet increment w/ int8

From: Ilya A. Kovalenko
Subject: Re: inet increment w/ int8
Date: ,
Msg-id: 119150172356.20050420123008@oganer.net
(view: Whole thread, Raw)
In response to: Re: inet increment w/ int8  (Greg Stark)
Responses: Re: inet increment w/ int8  (Bruno Wolff III)
List: pgsql-hackers

Tree view

inet increment w/ int8  ("Ilya A. Kovalenko", )
 Re: inet increment w/ int8  ("Ilya A. Kovalenko", )
 Re: inet increment w/ int8  (Bruce Momjian, )
  Re: inet increment w/ int8  ("Ilya A. Kovalenko", )
   Re: inet increment w/ int8  (Bruce Momjian, )
    Re: inet increment w/ int8  (Greg Stark, )
     Re: inet increment w/ int8  (Bruce Momjian, )
      Re: inet increment w/ int8  (Greg Stark, )
       Re: inet increment w/ int8  ("Ilya A. Kovalenko", )
        Re: inet increment w/ int8  (Bruno Wolff III, )
      Re: inet increment w/ int8  ("Ilya A. Kovalenko", )
    Re: inet increment w/ int8  (Bruno Wolff III, )
  Re: inet increment w/ int8  (Patrick Welche, )
 Re: inet increment w/ int8  (Bruce Momjian, )
  Re: inet increment w/ int8  (Douglas McNaught, )
   Re: inet increment w/ int8  (Bruce Momjian, )
    Re: inet increment w/ int8  (Stephen Frost, )
    Re: inet increment w/ int8  ("Sander Steffann", )

GS> I see a use case for of generating addresses based on a sequence or some
GS> primary key from the database.

GS> Something like

GS> CREATE SEQUENCE hosts_ip_seq MAXVALUE 65536;
GS> ALTER TABLE hosts ALTER ip SET DEFAULT '10.0.0.0/16'::inet + nextval(hosts_ip_seq')

hmm, not quite good idea - SEQUENCEs, by design, does not rollback next
value on transation rollback, so you'll have holes on address range when
other values will break some constraints or concurrent sessions
appears.






pgsql-hackers by date:

From: Pavel Stehule
Date:
Subject: Re: Foreign keys on array elements
From: Andreas Pflug
Date:
Subject: Re: [GENERAL] Idea for the statistics collector