Du kan bruge eksisterende funktioner network_smaller(inet, inet)
og network_larger(inet, inet)
for at definere dine egne aggregater:
create aggregate min (inet) (
sfunc = network_smaller,
stype = inet);
create aggregate max (inet) (
sfunc = network_larger,
stype = inet);
select min(d) min, max(d) max
from temp;
min | max
----------+------------
1.1.10.2 | 1.1.10.100
(1 row)