Search Postgresql Archives

testing castability of VARCHAR data to INET/CIDR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a VARCHAR column containing mostly ip addresses, with an
occasional piece of junk, and would like to transfer this data to an
INET column. The UPDATE (SET inet_col = CAST(vc_col AS INET)) aborts
as soon as it hits an invalid datum. I'm looking for a way to add
something like WHERE IS_CASTABLE(vc_col, INET) to the update.
Is there anything ready to use? I don't see anything directly usable
in src/backend/utils/adt/network.c.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux