Bug? Netmask of CIDR as TEXT has trailing masklen

From: nomad(at)null(dot)net
To: pgsql-general(at)postgresql(dot)org
Subject: Bug? Netmask of CIDR as TEXT has trailing masklen
Date: 2016-12-23 12:14:51
Message-ID: 20161223121451.GA25627@rekudos.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2016-12-23 12:41:24 Re: Is is safe to use SPI in multiple threads?
Previous Message Martijn Tonies (Upscene Productions) 2016-12-23 11:10:35 Re: Er Data Modeller for PostgreSQL