pg_sheet_fdw
pg_sheet_fdw · Read local Excel XLSX worksheets as PostgreSQL foreign tables
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101227 | pg_sheet_fdw | pg_sheet_fdw | 0.1.2 | FDW | MIT | C |
PostgreSQL · 13, 14, 15, 16, 17, 18
Usage
Sources:
pg_sheet_fdw 0.1.2 is a read-only foreign data wrapper for local Microsoft Excel .xlsx worksheets. It maps one sheet to a foreign table and converts cells into the PostgreSQL column types declared by the user. The spreadsheet remains a server-side file; this is not a Google Sheets or remote-object connector.
Core Workflow
filepath is mandatory and should be absolute. sheetname defaults to the first sheet, skiprows defaults to 0, and numberofthreads lets the parser choose automatically when omitted (explicit values are limited to 1–10). If batchsize is absent, the implementation derives a value intended to split the sheet into about 101 batches, with a minimum of 1,000 rows.
Data and Execution Boundaries
The PostgreSQL server operating-system user must be able to read the workbook and every directory in its path. Define columns in worksheet order with types matching the actual cells. The upstream examples show that some mismatches can be converted or saturated rather than rejected, so validate imports and cast into a staging table before relying on values.
The FDW handler implements scan callbacks only; it has no insert, update, or delete callbacks. Planner/executor support is basic, and the sheet parser may read substantially more data than a SQL filter returns. Large workbooks consume backend CPU and memory and can change independently of a transaction snapshot. The README reports tests on PostgreSQL 13 and CI on PostgreSQL 16; validate both build compatibility and workbook behavior on any other major version.