* Larry Rosenman <[EMAIL PROTECTED]> [001027 11:08]:
> * Tom Lane <[EMAIL PROTECTED]> [001027 09:49]:
> > Larry Rosenman <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

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

Reply via email to