dotted quad netmask conversion

From: Steve Clark <sclark(at)netwolves(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: dotted quad netmask conversion
Date: 2010-12-07 15:17:16
Message-ID: 4CFE4FFC.9010500@netwolves.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello All,

I am working with a postgresql database that has two columns.
One for an ip address and another for the netmask. Both of these
columns are char varying(30). I would like to convert to just
one column as inet. Any one know a slick way to convert the
dotted quad netmask, E.G. 255.255.128.0, to number of bits. I didn't
see any way directly looking at the network functions in the PG
documentation.

Thanks in advance for your consideration.
--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve(dot)clark(at)netwolves(dot)com
http://www.netwolves.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2010-12-07 15:19:17 Re: Do we want SYNONYMS?
Previous Message Raimon Fernandez 2010-12-07 15:14:28 Re: SELECT is immediate but the UPDATE takes forever