casting TEXT to CIDR (or to INET) has to be possible - Mailing list pgsql-bugs

From Paul Vixie
Subject casting TEXT to CIDR (or to INET) has to be possible
Date
Msg-id 20011220183848.8454B28EE9@as.vix.com
Whole thread Raw
Responses Re: casting TEXT to CIDR (or to INET) has to be possible  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name        :    Paul Vixie
Your email address    :    paul@vix.com


System Configuration
---------------------
  Architecture (example: Intel Pentium)      :    Intel Dual Pentium

  Operating System (example: Linux 2.0.26 ELF)     :    Freebsd 4.3

  PostgreSQL version (example: PostgreSQL-7.1.1):   PostgreSQL-7.2devel

  Compiler used (example:  gcc 2.95.2)        :    gcc version 2.95.3


Please enter a FULL description of your problem:
------------------------------------------------

I know there's code in the server to convert presentation-format INET or CIDR
into internal format.  To get the effect of C's "inet_netof()" I need to be
able to do this conversion from TEXT rather than from interpreter literals.


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

lartomatic=# select (host(relay)||'/18')::cidr from spam limit 5;
ERROR:  Cannot cast type 'text' to 'cidr'
lartomatic=# select (host(relay)||'/18')::inet from spam limit 5;
ERROR:  Cannot cast type 'text' to 'inet'



If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Nope, this is beyond my abilities.

pgsql-bugs by date:

Previous
From: Andrew Hill
Date:
Subject: Strange pg_oid problem.
Next
From: "Tony Nicol"
Date:
Subject: Problem creating database using windows2k + cygwin + cygipc