s3_fdw
s3_fdw · Foreign data wrapper for reading Amazon S3 files through PostgreSQL COPY format.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100105 | s3_fdw | s3_fdw | 0.1.0 | FDW | PostgreSQL | C |
Usage
Sources:
s3_fdw is an experimental, read-only foreign data wrapper that streams one Amazon S3 object into a foreign table using PostgreSQL COPY parsing options. The reviewed release is 0.1.0 from 2011; its transport and authentication design are obsolete, so treat it as historical code rather than a production S3 integration.
Core Workflow
Create the extension, register its foreign-data wrapper, and store the S3 credentials in a user mapping:
Map one object to a foreign table. The table column definitions must agree with the object contents and the chosen COPY options:
Options and Behavior
hostname,bucketname, andfilenameidentify the S3 endpoint, bucket, and object; all three foreign-table options are required.accesskeyandsecretkeyare user-mapping options used by the legacy S3 request signer.- Other foreign-table options are passed to PostgreSQL’s
COPYinput parser, allowing settings such asdelimiterto describe the object format. - The wrapper implements scan callbacks only. It does not support
INSERT,UPDATE, orDELETE, and it exposes no server-level options.
Operational Caveats
The implementation constructs an http:// URL and uses legacy AWS access-key signing; it does not provide modern HTTPS, region, session-token, or IAM-role handling. The secret key is stored in PostgreSQL catalog-visible user-mapping options. It also relies on a forked helper process and a Unix FIFO, and the upstream documentation explicitly calls the release unstable and unpredictable. Do not expose credentials or sensitive data through this code. For contemporary systems, use a maintained S3 FDW or an ingestion pipeline with current TLS and AWS authentication support.