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: 389337A7.3F02B63B@epamail.epa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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);
INSERT INTO test VALUES('192.168.1.2');
SELECT (host(ip) || '/24')::cidr FROM test;

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

Thanks in advance
- Mark

Responses

Browse pgsql-sql by date

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