PostgreSQL外部表错误:关系不存在。

3
我已创建了一个名为urltrackerft的外部表。
在我的外部服务器util中,它有一个名为urltracker的表: enter image description here enter image description here 我按照此处创建外部服务器和表的步骤进行了操作: https://www.postgresql.org/docs/current/postgres-fdw.html 我的创建脚本类似于这样:
CREATE FOREIGN TABLE urltrackerft (
    id numeric NOT NULL,
    ...
) SERVER util
OPTIONS (schema_name 'util', table_name 'urltracker');

但是当我尝试读取 urltrackerft 表时,出现了这个错误信息:enter image description here 对我来说,看起来可能是外部服务器没有同步。
检查用户映射,信息看起来正确,难道主机不是 IP 而是 DNS 吗?enter image description here 也许是防火墙或者一个服务器的 hba_conf 不正确。但是,我在主服务器中看到外部服务器 util。对于这个问题有什么帮助吗?谢谢!
主服务器运行 PostgreSQL v10,而外部服务器运行 PostgreSQL v11。
1个回答

4
你的外部表似乎在名为util的数据库的模式public中,如果我看你的图示没错的话。
那么下面的外部表定义无法进行也就不足为奇了:
OPTIONS (schema_name 'util', table_name 'urltracker')

请使用schema_name 'public'代替。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接