【1】创建file_fdw
create extension file_fdw;
create server server_file_fdw foreign data wrapper file_fdw;
[2] 建立外部表
就以常见emp表为例; create foreign table test01 ( colname1 VARCHAR(200),colname2 VARCHAR(200),
colname3 VARCHAR(200),
infovalue NUMERIC(18,2),
infovalue2 NUMERIC(18,2),
infovaluetb NUMERIC(18,6) )SERVER server_file_fdw OPTIONS (format 'csv',header 'false',filename '/data/testdata.csv', delimiter ',', null ''); 【3】查询表 mydb=# select * from test01; 标签:200,VARCHAR,file,外部,创建,create,NUMERIC,fdw,postgresql From: https://www.cnblogs.com/qsds/p/16612221.html