makedate extension for http://stackoverflow.com/questions/17672538/postgresql-select-integers-as-date-or-timestamp