postgres error fix to db