
上QQ阅读APP看书,第一时间看更新
How it works…
Many people name the password file .pgpass, whether or not they are on Windows, so don't get confused if they do this.
The password file can contain multiple lines. Each line is matched against the requested host:port:dbname:user combination until we find a line that matches. Then, we use that password.
Each item can be a literal value or *, a wildcard that matches anything. There is no support for partial matching. With appropriate permissions, a user can potentially connect to any database. Using the wildcard in the dbname and port fields makes sense, but it is less useful in other fields. Here are a few examples:
- myhost:5432:*:sriggs:moresecurepw
- myhost:5432:perf:hannu:okpw
- myhost:*:perf:gianni:sicurissimo