Postgresql has the inet and cidr datatypes and some great functions for these types, very useful for storing and manipulating data for IP addresses and networks. Here is how to query for the next sequentially available IP address in a given table. As a basic example, say you were storing hostnames and IP addresses as… Read more »