move postgres code to dw