A foreign data wrapper for accessing CSV, JSON, EXCEL and ODF files on cloud filesystems.
CREATE EXTENSION multicorn;
CREATE SERVER <server> FOREIGN DATA WRAPPER multicorn OPTIONS (wrapper 'cloudfs_fdw.cloudfs_fdw.cloudfs_fdw');
CREATE USER MAPPING FOR <user> SERVER <server>;
CREATE FOREIGN TABLE <schema>.<table> (...) SERVER <server> OPTIONS (<options>);
See this for general information how SQL/MED in PostgreSQL works, and this for CREATE FOREIGN TABLE syntax.
- source 's3'
- bucket <bucket>
- filepath <filename>
- host <host>, default: localhost
- port <port>, default: 443
- region <region>
- aws_access_key <access_key>
- aws_secret_key <secret_key>
- source 'http/https'
- url <URL>
- source 'file'
- filepath <filepath>
- format 'json'
- json_path <json_path>
- format 'csv'
- header <true/false>
- delimiter <delimiter>, default: ,
- quote_char <quote_char>, default: "
- format 'excel'
- header <true/false>
- sheet <sheet_name>, default: first sheet
- format 'odf'
- header <true/false>
- sheet <sheet_name>, default: first sheet
'.gz' and '.zip' compressed files are decompressed automagically.