pg_foreign_table — PostgreSQL system catalog

The PostgreSQL pg_foreign_table system catalog: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

The catalog pg_foreign_table contains auxiliary information about foreign tables. A foreign table is primarily represented by a pg_class entry, just like a regular table. Its pg_foreign_table entry contains the information that is pertinent only to foreign tables and not any other kind of relation.

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_foreign_table system catalog exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • ftrelid oid references pg_class.oid
    The OID of the pg_class entry for this foreign table
  • ftserver oid references pg_foreign_server.oid
    OID of the foreign server for this foreign table
  • ftoptions text[]
    Foreign table options, as “keyword=value” strings

Related catalogs

This object references the following other system catalogs:

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_foreign_table.