Thread: [GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen

[GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen

From
nomad@null.net
Date:
The following displays as I would expect:

    mark=# select netmask('1.1.1.0/24');
        netmask
    ---------------
     255.255.255.0
    (1 row)

However the following does not look right:

    mark=# select netmask('1.1.1.0/24')::text;
         netmask
    ------------------
     255.255.255.0/32
    (1 row)

The trailing "/32" should not be there. I have been trying to compare
TEXT strings like '255.255.255.0' with the netmask of a CIDR column and
the above is making it difficult.

Regards,
Mark
--
Mark Lawrence