Cloud

pg_foreign_table

The pg_foreign_table stores one row for each table in a Redpanda catalog or Iceberg catalog. Each row links the table to its catalog. It mimics the pg_foreign_table PostgreSQL system catalog.

Each table in this catalog also has a row in pg_class, with relkind set to f.

The tables that a role sees follow the rules in Tables in Redpanda and Iceberg catalogs.

Columns

The following columns are available for querying in pg_foreign_table:

Column Type Description

ftrelid

int

The OID of the table. References pg_class.oid.

ftserver

int

The OID of the catalog that the table belongs to. References pg_foreign_server.oid.

ftoptions

text

Unused. This column is always empty.

Examples

List each table in a catalog, with the catalog name:

SELECT s.srvname, c.relname
FROM pg_foreign_table t
JOIN pg_class c ON c.oid = t.ftrelid
JOIN pg_foreign_server s ON s.oid = t.ftserver
ORDER BY 1, 2;

The relname value does not include the catalog name. For a table in an Iceberg catalog, relname includes the Iceberg namespace, such as redpanda.orders. For a topic-backed table in a Redpanda catalog, relname is the table name, such as orders.