ERROR: invalid CIDR value '216.192.153.1/26': has bits set to right of mask

Can anyone tell me what's wrong here? To me, that value appears to fit the specifications from the PostgreSQL documetation:

The input format for this type is x.x.x.x/y where x.x.x.x is an IP address and y is the number of bits in the netmask. If the /y part is left off, then the netmask is 32, and the value represents just a single host. On display, the /y portion is suppressed if the netmask is 32.

See:
http://postgresql.crimelabs.net/users-lounge/docs/7.1/user/datatype-net-types.html
for full documentation

Thanks!

    My guess is that by address they don't mean "any old address" but rather any network address. In other words, if the mask is /26, the last octet must be one of 0, 32, 64 ...

      As near as I can tell it's a bug in the CIDR checking that's snuck in.

      You can just use inet as the type and put the netmask after that address.

        Write a Reply...