Fix postgres issues