12th September 2019: PostgreSQL 12 Beta 4 Released!
Unsupported versions: 7.0
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the supported versions listed above instead.

IP V4 CIDR Operators

Table 4-6. PostgresIP V4 CIDR Operators

Operator Description Usage
< Less than '192.168.1.5'::cidr < '192.168.1.6'::cidr
<= Less than or equal '192.168.1.5'::cidr <= '192.168.1.5'::cidr
= Equals '192.168.1.5'::cidr = '192.168.1.5'::cidr
>= Greater or equal '192.168.1.5'::cidr >= '192.168.1.5'::cidr
> Greater '192.168.1.5'::cidr > '192.168.1.4'::cidr
<> Not equal '192.168.1.5'::cidr <> '192.168.1.4'::cidr
<< is contained within '192.168.1.5'::cidr << '192.168.1/24'::cidr
<<= is contained within or equals '192.168.1/24'::cidr <<= '192.168.1/24'::cidr
>> contains '192.168.1/24'::cidr >> '192.168.1.5'::cidr
>>= contains or equals '192.168.1/24'::cidr >>= '192.168.1/24'::cidr