CREATE OR REPLACE VIEW public_user AS
SELECT
t.username, t.userid
FROM
dblink('host=127.0.0.1 dbname=库名称 user=pgsql password=密码'::text, 'select username,userid from 表名称'::text) t(username character varying(50), userid character varying(100));
ALTER TABLE 表名称
OWNER TO postgres;
COMMENT ON VIEW public_user
IS '用户表';