-- 创建拓展 create extension postgres_fdw; drop SERVER postgres CASCADE; --递归删除 会删除已经通过fdw创建的表
-- 创建一个server name postgres create server postgres foreign data wrapper postgres_fdw options (host '127.0.0.1', port '5432', dbname 'postgres'); create user mapping for public server postgres options (user 'postgres', password 'postgres'); -- 基于server name 创建关联表 替代dblink (可以理解为视图) create foreign table tablename11( czrk numeric, xzqdm character varying, shengming character varying, shiming character varying, xianming character varying, xiangzhen character varying, dzxiang character varying, gid numeric) server postgres options (schema_name 'riskevaluate', table_name 'tablename');
标签:postgres,create,使用,character,server,fdw,varying From: https://www.cnblogs.com/qukaige/p/16836451.html