fix parse_datetime to work with pg