[GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen - Mailing list pgsql-general

From nomad@null.net
Subject [GENERAL] Bug? Netmask of CIDR as TEXT has trailing masklen
Date
Msg-id 20161223121451.GA25627@rekudos.net
Whole thread Raw
List pgsql-general
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


pgsql-general by date:

Previous
From: "Martijn Tonies \(Upscene Productions\)"
Date:
Subject: Re: [GENERAL] Er Data Modeller for PostgreSQL
Next
From: "Peter J. Holzer"
Date:
Subject: Re: [GENERAL] Is is safe to use SPI in multiple threads?