Postgres Select Into Record Variable Interval Graph