Re: How to covert 'char' to 'inet' - Mailing list pgsql-general

From mnihas@poczta.onet.pl (Michal O)
Subject Re: How to covert 'char' to 'inet'
Date
Msg-id dc10011f.0207240040.4bb09b96@posting.google.com
Whole thread Raw
In response to Re: How to covert 'char' to 'inet'  (Andrew Sullivan <andrew@libertyrms.info>)
Responses Re: How to covert 'char' to 'inet'  (Andrew Sullivan <andrew@libertyrms.info>)
List pgsql-general
Thank you. What I did was:

  inet(trim(both ' ' from server_ip::text))

and worked fine. Convertion to 'text' was needed.
Do you know how time consuming it is ? Is there more efficient way ?

Best regards
  Michal Otroszczenko

> > I've tried cast to convert char to inet, but that is no good waw :((.
> > Does anybody know how to do that ?
>
> Try trim(charfield)::inet.  Worked for me.  I think the problem is
> that char is padded.
>
> A

pgsql-general by date:

Previous
From: montie76@yahoo.com (montfort)
Date:
Subject: Granting permission to root.
Next
From: Nelson Marisco
Date:
Subject: Inquiry From Form [pgsql]