file_fdw
foreign-data wrapper for flat file access
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
file_fdw | 1.0 | FDW | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 8980 | file_fdw | No | Yes | No | Yes | No | No | - |
| Related | aws_s3 pg_bulkload pg_parquet pg_lake pg_csv pg_ducklake pg_fact_loader log_fdw omni_csv pg_sqlog |
|---|---|
| Depended By | pg_sqlog |
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
Create Server
Read a CSV File
Read PostgreSQL CSV Logs
Read Program Output
Table Options
| Option | Description |
|---|---|
filename | File path (relative to data directory). Required unless program is used |
program | Shell command whose stdout is read. Required unless filename is used |
format | Data format: csv, text, or binary (same as COPY) |
header | true if file has a header row |
delimiter | Column delimiter character |
quote | Quote character |
escape | Escape character |
null | String representing NULL values |
encoding | Data encoding |
on_error | Error handling during type conversion |
reject_limit | Maximum tolerated errors |
Column Options
| Option | Description |
|---|---|
force_not_null | Do not match column values against the null string |
force_null | Match quoted values against the null string and return NULL |
file_fdw is read-only. Changing table-level options requires superuser privileges or the pg_read_server_files / pg_execute_server_program role.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)