P.S. almost foget, do not try any oracle-like "tree-jouns" or "special types" or such a crap. your problem as plain as to store a pair of integers (or numerics (i prefer))
pgsql-sql by date:
Соглашаюсь с условиями обработки персональных данных