pg_tier
pg_tier · Tier PostgreSQL table data to external S3 storage through parquet_s3_fdw.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101254 | pg_tier | pg_tier | 0.0.5 | OLAP | Apache-2.0 | Rust |
PostgreSQL · 14, 15, 16
| Relationships | |
|---|---|
| Requires | parquet_s3_fdw |
Usage
Sources:
- Upstream README at the reviewed commit
- Extension control file
- SQL API and tiering workflow
- Rust implementation
- Cargo metadata
pg_tier moves a local table to S3-compatible storage through its required parquet_s3_fdw dependency, then exposes the data under the original table name as a foreign table.
Core Workflow
The example uses psql variables so no real credential is hard-coded in the document. Variable expansion still sends values to PostgreSQL, where statement logging can capture them; prefer client protocol parameters and appropriate logging controls.
Safety and Caveats
tier.set_tier_configstores the bucket, access key, secret key, and region as text intier.server_credential, and creates an FDW user mappingFOR public. Restrict extension tables and management functions, protect backups, and use a dedicated least-privilege bucket identity.- The setup function creates a fixed server named
pg_tier_s3_srv. Repeated configuration or an existing object with that name can fail; test lifecycle and recovery procedures before operating it. - Enabling tiering renames the local table, creates a foreign table under the original name, and records both in extension catalogs. Execution writes the remote data and normally truncates the renamed local table.
- Verify the dependency’s credential, endpoint, and TLS behavior. The reviewed build targets PostgreSQL 14 through 16 and has no PostgreSQL 17 or later feature.
Upstream explicitly labels version 0.0.5 beta and unsuitable for production because bugs and concurrency issues may exist. Tiering changes the table’s storage and object identity and can expose partial-failure boundaries between PostgreSQL and S3. Test row counts, constraints, indexes, permissions, concurrent writes, rollback, backup, restore, and recovery. Keep an independently verified copy until remote data and replacement foreign table are proven complete.