treasuredata_fdw
treasuredata_fdw · C foreign data wrapper backed by a Rust td-client bridge for querying and inserting Treasure Data datasets.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100379 | treasuredata_fdw | treasuredata_fdw | 1.2 | FDW | Apache-2.0 | C |
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
Usage
Sources:
- Pinned current upstream README
- Pinned extension control file
- Pinned distribution metadata
- Pinned option and credential handling
- Pinned Rust bridge dependencies
- Formal PGXN distribution
treasuredata_fdw connects PostgreSQL to the Treasure Data service using Hive or Presto jobs. Foreign tables can query a remote table or fixed remote SQL, push selected filters and aggregates, stream or download results, insert data in chunks, and be generated with IMPORT FOREIGN SCHEMA.
Define a read-only foreign table
The reviewed validator accepts credentials and connection options on the foreign table itself:
The extension object version is 1.2, matching this catalog. The pinned repository metadata identifies distribution 1.2.16, while the captured PGXN page lists 1.2.15 as its latest stable release. Do not compare those package versions directly with the SQL object version.
Remote transaction and secret boundaries
The required API key is stored in foreign-table options rather than a protected user mapping. Catalog access, schema dumps, backups, support bundles, IMPORT-generated commands, and administrative logs can expose it. Restrict catalog and table ownership, use a narrowly scoped key, avoid sharing definitions, rotate regularly, and verify the service endpoint.
Queries and imports are synchronous remote jobs that can run for hours while holding a PostgreSQL backend. The optional result-download directory writes compressed files on the database server. INSERT with atomic_import disabled uploads chunks that may become remotely visible before the local statement commits; aborting PostgreSQL does not roll back prior remote imports. Atomic mode stages a remote table and performs a final copy, but it is still not PostgreSQL two-phase commit and can leave remote resources after failures.
The Rust bridge uses old HTTP, time, retry, and Treasure Data client dependencies, contains unwrap and panic paths, and the repository’s last source commit is from 2023. Test TLS, cancellation, timeouts, retry duplication, partial import, cleanup, unsupported types, remote SQL injection boundaries, local disk exhaustion, schema drift, and current Treasure Data APIs. Grant foreign-table access only after documenting cost and data-egress policy.