Re: converting from text -> inet ... possible?

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: converting from text -> inet ... possible?
Date: 2001-01-18 19:46:38
Message-ID: 3A67481E.61D5BF6A@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The Hermit Hacker wrote:
>
> I scanned the archives, and one person asked it back in July, but there
> doesn't appear to be any followup ...
>
> Is it possible to go from text->inet in v7.0.3? if not, is it in v7.1?
>
> the following doesn't work:
>
> template1=# select '216.126.84.1'::text::inet;
> ERROR: Cannot cast type 'text' to 'inet'

You could use something like that:
hannu=# select inet_in(textout('127.0.0.1/24'::text)) as n;
n
--------------
127.0.0.1/24
(1 row)
-------------------------------
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2001-01-18 20:58:17 Re: OLD.oid issues...
Previous Message Rod Taylor 2001-01-18 19:42:20 OLD.oid issues...