Skip to content

foreign_table_exposer

Exposes foreign tables as regular tables for catalog-based clients.

foreign_table_exposer · Exposes foreign tables as regular tables for catalog-based clients.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100147foreign_table_exposerforeign_table_exposer1.0UTILApache-2.0C

PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18

Usage

Sources:

foreign_table_exposer 1.0 makes catalog clients that search only for ordinary tables and views discover PostgreSQL foreign tables. It does this by rewriting qualifying pg_catalog.pg_class queries, not by changing foreign-table storage or transaction semantics.

Core Workflow

Load the module at server start, restart PostgreSQL, and enable its SQL objects in each database that needs the behavior.

shared_preload_libraries = 'foreign_table_exposer'
CREATE EXTENSION foreign_table_exposer;

After activation, a catalog predicate equivalent to relkind IN ('r', 'v') is rewritten to include foreign tables with relkind f. This targets older BI and metadata tools that otherwise hide them.

Operational Boundaries

The rewrite hook affects matching catalog queries throughout the server and can surprise clients that intentionally exclude foreign tables. It does not make FDW operations local, transactional, or inexpensive. The release dates from 2015; test it on the exact PostgreSQL major, with other hook-using extensions, and against each client query before production use.

Table reader