1

我正在观察 9.2.3 和 9.2.4 之间的 dblink 行为差异。我有两台具有相同 postgres.conf 和 pg_hba.conf 的服务器。但是,一个在 9.2.3 版本上,一个在 9.2.4 上

9.2.3

pg_hba.conf 有

    local   all     dblinkuser      trust

然后我使用任何普通用户连接到数据库

    theater_map=# select dblink_connect('dbname=TheaterDB user=dblinkuser password=dbl123');
    dblink_connect 
    ----------------
    OK
    (1 row)

连接成功。

9.2.4

我的 pg_hba.conf 具有与上面相同的条目

    theater_map=> select dblink_connect('dbname=TheaterDB user=dblinkuser password=dbl123');
    ERROR:  password is required
    DETAIL:  Non-superuser cannot connect if the server does not request a password.
    HINT:  Target server's authentication method must be changed.

现在我在 9.2.4 上更改我的 pg_hba.conf 如下

    local   all     dblinkuser      md5

并重新启动 postgres

    theater_map=> select dblink_connect('dbname=TheaterDB user=dblinkuser password=dbl123');
    dblink_connect 
    ----------------
   OK
   (1 row)

我检查了版本 9.2.3 和 9.2.4 之间的更改日志,但找不到任何详细信息。

注意:在 9.2.3 上将身份验证方法从 trust 更改为 md5 没有任何区别,并且仍然有效。

4

0 回答 0