pg_foreign_table
pg_foreign_table
is a system catalogue table containing metadata for foreign tables.
pg_foreign_table
was added in PostgreSQL 9.1.
psql commands
\dE
or \det
list foreign tables.
Definition by PostgreSQL version
pg_foreign_table (PostgreSQL 14)
Table "pg_catalog.pg_foreign_table" Column | Type | Collation | Nullable | Default -----------+--------+-----------+----------+--------- ftrelid | oid | | not null | ftserver | oid | | not null | ftoptions | text[] | C | | Indexes: "pg_foreign_table_relid_index" PRIMARY KEY, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 13)
Table "pg_catalog.pg_foreign_table" Column | Type | Collation | Nullable | Default -----------+--------+-----------+----------+--------- ftrelid | oid | | not null | ftserver | oid | | not null | ftoptions | text[] | C | | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 12)
Table "pg_catalog.pg_foreign_table" Column | Type | Collation | Nullable | Default -----------+--------+-----------+----------+--------- ftrelid | oid | | not null | ftserver | oid | | not null | ftoptions | text[] | C | | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 11)
Table "pg_catalog.pg_foreign_table" Column | Type | Collation | Nullable | Default -----------+--------+-----------+----------+--------- ftrelid | oid | | not null | ftserver | oid | | not null | ftoptions | text[] | | | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 10)
Table "pg_catalog.pg_foreign_table" Column | Type | Collation | Nullable | Default -----------+--------+-----------+----------+--------- ftrelid | oid | | not null | ftserver | oid | | not null | ftoptions | text[] | | | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 9.6)
Table "pg_catalog.pg_foreign_table" Column | Type | Modifiers -----------+--------+----------- ftrelid | oid | not null ftserver | oid | not null ftoptions | text[] | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 9.5)
Table "pg_catalog.pg_foreign_table" Column | Type | Modifiers -----------+--------+----------- ftrelid | oid | not null ftserver | oid | not null ftoptions | text[] | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 9.4)
Table "pg_catalog.pg_foreign_table" Column | Type | Modifiers -----------+--------+----------- ftrelid | oid | not null ftserver | oid | not null ftoptions | text[] | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 9.3)
Table "pg_catalog.pg_foreign_table" Column | Type | Modifiers -----------+--------+----------- ftrelid | oid | not null ftserver | oid | not null ftoptions | text[] | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 9.2)
Table "pg_catalog.pg_foreign_table" Column | Type | Modifiers -----------+--------+----------- ftrelid | oid | not null ftserver | oid | not null ftoptions | text[] | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
pg_foreign_table (PostgreSQL 9.1)
Table "pg_catalog.pg_foreign_table" Column | Type | Modifiers -----------+--------+----------- ftrelid | oid | not null ftserver | oid | not null ftoptions | text[] | Indexes: "pg_foreign_table_relid_index" UNIQUE, btree (ftrelid)
Documentation: pg_foreign_table
Change history
- PostgreSQL 9.1
- added (commit 0d692a0d)
This table has not been modified since it was added in PostgreSQL 9.1.
Examples
postgres=# CREATE FOREIGN TABLE foo_remote (id INT) SERVER fdw_test OPTIONS(table_name 'foo'); CREATE FOREIGN TABLE postgres=# SELECT * FROM pg_foreign_table; ftrelid | ftserver | ftoptions ---------+----------+------------------ 16482 | 16459 | {table_name=foo} (1 row)
References
- PostgreSQL documentation: pg_foreign_table