pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Volpe <volpe.mark@epamail.epa.gov>
To: pgsql-sql@postgresql.org
Subject: inet/cidr - can this be done?
Date: Sat, 29 Jan 2000 13:55:35 -0500
Message-ID: <389337A7.3F02B63B@epamail.epa.gov> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <389337A7.3F02B63B@epamail.epa.gov>
Permalink:  ../389337A7.3F02B63B@epamail.epa.gov/
Also on:    postgresql.org/message-id/389337A7.3F02B63B@epamail.epa.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: volpe.mark@epamail.epa.gov
  Subject: Re: inet/cidr - can this be done?
  In-Reply-To: <389337A7.3F02B63B@epamail.epa.gov>
  References: <389337A7.3F02B63B@epamail.epa.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox