Converting an int to an IP address

Posted by User1 on Stack Overflow See other posts from Stack Overflow or by User1
Published on 2010-05-21T23:15:36Z Indexed on 2010/05/21 23:20 UTC
Read the original article Hit count: 174

Filed under:

Is there an easy way to convert an int to an IP address in PostgreSQL? I was able to go from IP to int using this code:

SELECT inet '1.2.3.4'-'0.0.0.0'

This doesn't work:

SELECT 16909060::inet

I didn't see anything in the documentation. Does anyone know how to do this?

© Stack Overflow or respective owner

Related posts about postgresql