【发布时间】:2018-01-23 13:33:49
【问题描述】:
我正在尝试使用 Forigen Data Wrapper 从 A 表中获取数据到另一个数据库。
它在我的系统中运行良好。但是相同的命令在远程服务器中引发错误。
CREATE FOREIGN DATA WRAPPER fwd_test VALIDATOR postgresql_fdw_validator;
CREATE SERVER ser_test FOREIGN DATA WRAPPER fwd_test OPTIONS (hostaddr '127.0.0.1', dbname 'database_one', port '5433');
CREATE USER MAPPING FOR postgres SERVER ser_test OPTIONS (user 'postgres', password 'emr123');
SELECT dblink_connect('ser_test');
并且服务器返回以下错误
ERROR: could not establish connection SQL state: 08001 Detail: missing "=" after "ser_test" in connection info string
同一组行在本地实例中工作。
【问题讨论】:
-
dblink_connect 用于检查这里的连接。
-
@a_horse_with_no_name:令人惊讶的是,
dblink_connect()将接受外部服务器名称来代替连接字符串:postgresql.org/docs/current/static/…