1. 建立跨数据库函数 create extension dblink; 2.实现跨数据库查询 select temp.odm as itemname from dblink('host=127.127.127.127 dbname=portal_uat user=postgres password=123456'::text,'SELECT DISTINCT(odm) from dim_product'::text) temp (odm character varying(50))