
The [file_fdw](https://www.postgresql.org/docs/15/file-fdw.html) module provides the foreign-data wrapper `file_fdw`, which can be used to access data files in the server's file system, or to execute programs on the server and read their output.

To enable the extension:

```sql
CREATE EXTENSION file_fdw;
```

Create a foreign server:

```sql
CREATE SERVER my_server FOREIGN DATA WRAPPER file_fdw;
```

Now, you can create foreign tables that access data from files. For example:

```sql
CREATE FOREIGN TABLE employees (id int, employee_name varchar) SERVER my_server OPTIONS (filename 'employees.csv', format 'csv');
```

You can execute `SELECT` statements on the foreign tables to access the data in the corresponding files.
