Re: Summary: what to do about INET/CIDR

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Summary: what to do about INET/CIDR
Date: 2000-10-27 16:13:52
Message-ID: 20001027111352.A5543@lerami.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Larry Rosenman <ler(at)lerctr(dot)org> [001027 11:08]:
> * Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [001027 09:49]:
> > Larry Rosenman <ler(at)lerctr(dot)org> writes:
> > > Also a way to get network (.0) and broadcast (all ones) for a cidr
> > > block out of our stuff.
> >
> > network() and broadcast() have been there all along ...
> OK, what I really meant was a way to coerce a CIDR entity to INET so
> that host() can work with a CIDR type to print all 4 octets.
>
> Does this help with what I want?
>
> Currently you can't coerce a CIDR type to INET.
For example, I feel the following should work:

ler=# \d ler_test
Table "ler_test"
Attribute | Type | Modifier
-----------+------+----------
net | cidr |
host | inet |

ler=# select * from ler_test;
net | host
---------------+------------------
207.158.72/24 | 207.158.72.11/24
(1 row)

ler=# select host(net::inet) from ler_test;
ERROR: CIDR type has no host part
ERROR: CIDR type has no host part
ler=#
>
> >
> > regards, tom lane
> --
> Larry Rosenman http://www.lerctr.org/~ler
> Phone: +1 972-414-9812 (voice) Internet: ler(at)lerctr(dot)org
> US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 (voice) Internet: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-10-27 16:18:51 LIMIT in DECLARE CURSOR: request for comments
Previous Message Larry Rosenman 2000-10-27 16:08:24 Re: Summary: what to do about INET/CIDR