在 Postgres 9.6 中创建外部数据包装器时,如果我使用以下内容:
CREATE SERVER foreign_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'localhost', dbname 'database', port '5432');
-- permissions
ALTER SERVER foreign_server OWNER TO data_owner;
-- Allow a user to access the foreign server if required
GRANT USAGE ON FOREIGN SERVER foreign_server to data_owner;
-- 4. Create foreign user mapping - using md5 encrypted password
CREATE USER MAPPING FOR data_owner SERVER foreign_server
OPTIONS ( USER 'jeff', PASSWORD 'md5de0366066f8d96ac5bb4872b1d77b0cb!');
-- 5. Create foreign table
IMPORT FOREIGN SCHEMA foo EXCEPT
(bar )
FROM SERVER foreign_server INTO foreign_tables_schema;
为什么会出现错误,当我使用明文密码时一切正常,但是当我使用加密的 md5 密码时,我无法导入外部表。
有什么想法吗?