Fixing type in postgres script