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