First pass to make it postgres compatible.