Fix statuses latest ordering for postgresql