Re: Why?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: vladimir(at)sycore(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why?
Date: 2005-01-20 00:36:42
Message-ID: 1056.1106181402@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Vladimir S. Petukhov" <vladimir(at)sycore(dot)org> writes:
> select * from nets;
> name | note | net
> ------+------+---------------
> | | 172.16.0.0/16
> (1 row)

> select * from nets where net >>= '172.16.4.0/8';
> name | note | net
> ------+------+-----
> (0 rows)

Are you confusing >>= with <<= perhaps? The >>= operator tests

ip_bits(a1) <= ip_bits(a2)
&& bitncmp(ip_addr(a1), ip_addr(a2), ip_bits(a1)) == 0

which looks reasonable enough to me. By that logic a /16 net
can never be a supernet of a /8 net.

regards, tom lane

In response to

  • Why? at 2005-01-20 03:15:52 from Vladimir S. Petukhov

Browse pgsql-general by date

  From Date Subject
Next Message Uwe C. Schroeder 2005-01-20 00:48:13 Re: need an advice on running Database
Previous Message Dann Corbit 2005-01-20 00:28:11 Re: Unique Index