> Is it possible to go from text->inet in v7.0.3?  if not, is it in v7.1?

Seems to not be in 7.1 either.

                         - Thomas

Thu, 18 Jan 2001 14:03:25 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: converting from text -> inet ... possible?

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'

but I could be missing something in the docs?


Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org


Thu, 18 Jan 2001 10:43:17 -0400 (AST)
The Hermit Hacker <scrappy@hub.org>
converting from text -> inet ... possible?

how hard would it be to rectify before beta4 is put out?  i'm doing a
manual dump/restore to get my data from text->inet ... not elegant, but it
works ... ::)

On Thu, 18 Jan 2001, Thomas Lockhart wrote:

> > Is it possible to go from text->inet in v7.0.3?  if not, is it in v7.1?
>
> Seems to not be in 7.1 either.
>
>                          - Thomas
>

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org


Thu, 18 Jan 2001 11:17:03 -0400 (AST)
The Hermit Hacker <scrappy@hub.org>
Re: converting from text -> inet ... possible?
Is this a TODO item?

> 
> 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'
> 
> but I could be missing something in the docs?
> 
> 
> Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
> Systems Administrator @ hub.org
> primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org
> 
> 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 18 Jan 2001 13:14:33 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: converting from text -> inet ... possible?
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

Thu, 18 Jan 2001 19:46:38 +0000
Hannu Krosing <hannu@tm.ee>
Re: converting from text -> inet ... possible?
> Is this a TODO item?

Yup. Somehow there is a conversion from inet to text, but not the other
way around.

                  - Thomas

Fri, 19 Jan 2001 00:53:52 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: converting from text -> inet ... possible?
Added to TODO:

	* Add conversion function from text to inet

> > Is this a TODO item?
> 
> Yup. Somehow there is a conversion from inet to text, but not the other
> way around.
> 
>                   - Thomas
> 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 18 Jan 2001 21:06:02 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: converting from text -> inet ... possible?