Solved issues with postgres and restore script