Fixing postgresql with open permissions