Search Postgresql Archives

Re: Why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Vladimir S. Petukhov" <vladimir@xxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux