fixed postgres script after review with Stephen S