Thread: operating "inet" type

operating "inet" type

From
"Ilya A. Kovalenko"
Date:
Greetings,
 I'm confused, that PostgreSQL seems to don't have operators/functions
for examining/modifying "inet" data type. No any octet/word-based means
(like extract/replace), no even, trivial integer increments. No conversions, except conversion to symbolic string
(parsingit is
 
a mess and overhead). No even binary string conversions.
 You can do integer compare two "inet" values, but you can't do
integer increment (i.e. increment inet value by integer).
 I understand, that developers has more important things to do, but
they left "inet" type w/o any ways to work w/ it. Parsing "inet" converted text can't be, seriously, taken as
alternative,
but using numeric types to store addresses (and ignore native "inet"
type) really, can.
 I'm using PostgreSQL 7.4.3, Can 8.0.1 do more ?

Thank you.

Ilya A. Kovalenko    (mailto:shadow@oganer.net)
SpecialEQ SW section
JSC Oganer-Service 



Re: operating "inet" type

From
Bruno Wolff III
Date:
On Tue, Apr 12, 2005 at 20:34:04 +0800, "Ilya A. Kovalenko" <shadow@oganer.net> wrote:
> 
>   You can do integer compare two "inet" values, but you can't do
> integer increment (i.e. increment inet value by integer).

It would probably be useful to have some way of generating a list of
addresses in a subnet. Being able to increment addresses and having a
way to get the highest and lowest addresses in a subnet would give you
a way to do that.

>   I understand, that developers has more important things to do, but
> they left "inet" type w/o any ways to work w/ it.

You can write your own functions to do this. It is possible that they
could go back into the code base if they seem generally useful.

If you are interested in getting them back into the code base, you are probably
best off proposing specs for the functions on the hackers lists for comments,
before writing them.