Skip site navigation (1) Skip section navigation (2)

inet/cidr - can this be done?

From: Mark Volpe <volpe(dot)mark(at)epamail(dot)epa(dot)gov>
To: pgsql-sql(at)postgresql(dot)org
Subject: inet/cidr - can this be done?
Date: 2000-01-29 18:55:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Is there a way to convert inet types
to cidr? I have a table with an inet
field, and it would be cool to, say,
group by class C network. My little attempt
here results in an error:

CREATE TABLE test(ip inet);
SELECT (host(ip) || '/24')::cidr FROM test;

ERROR:  No such function 'cidr' with the specified attributes

Thanks in advance
- Mark


pgsql-sql by date

Next:From: Roland RobertsDate: 2000-01-30 03:59:45
Subject: Where is `COMMENT ON' syntex documented
Previous:From: Peter EisentrautDate: 2000-01-29 11:14:13
Subject: Re: [SQL] transaction aborted

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group