I'm using the 'inet' datatype of postgresql and there are some problems with it, that need to be solved:
I have a column of type inet where I need to select the smallest value in range x-z from thats not in the table.
For explanation: This is a table of computers with ip-adress. We've got a subnet from our University that we may use. So we have an upper and a lower bound for ips. We also have some servers and switches that have fixed adresses, so we can only use .10 to .250 for pcs.
Now, if we get a new PC, I need to select the lowest number of available ips thats unused. I need to keep the upper area en block for dynamic use with dhcp.
The problem is, that you cant increment 'inet' and also cant take the minimum from an inet column!
thanks for any hints in the right direction!!!
[one solution would be a 2nd table with all available ips, but in my eyes that would be a hack]