按 PostgreSQL 版本定义
pg_foreign_table (PostgreSQL 17)
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)
文档: pg_foreign_table
pg_foreign_table (PostgreSQL 16)
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)
文档: pg_foreign_table
pg_foreign_table (PostgreSQL 15)
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)
文档: pg_foreign_table
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)
文档: 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)
文档: 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)
文档: 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)
文档: 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)
文档: 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)
文档: 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)
文档: 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)
文档: 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)
文档: 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)
文档: 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)
文档: pg_foreign_table
更改历史记录
- PostgreSQL 9.1
- 添加 (提交 0d692a0d)
自添加于PostgreSQL 9.1以来,此表未被修改过。
示例
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)
参考文献
- PostgreSQL 文档: pg_foreign_table