> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-foreign-table.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 52.25. pg\_foreign\_table \#

### 52.25. `pg_foreign_table` [#](#catalog-pg-foreign-table) <a href="#catalog-pg-foreign-table" id="catalog-pg-foreign-table"></a>

目錄 `pg_foreign_table` 存放外部資料表的輔助資訊。外部資料表主要以 [`pg_class`](https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-class.md) 項目表示，就像一般資料表一樣。它在 `pg_foreign_table` 中的項目，則存放只與外部資料表相關、而與其他任何種類的關聯無關的資訊。

#### 表 52.25. `pg_foreign_table` 欄位 [#](#catalog-pg-foreign-table-columns) <a href="#catalog-pg-foreign-table-columns" id="catalog-pg-foreign-table-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><code>ftrelid</code> <code>oid</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-class.md"><code>pg\_class</code></a>.<code>oid</code>）</p><p>此外部資料表之 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-class.md"><code>pg\_class</code></a> 項目的 OID</p> |
| <p><code>ftserver</code> <code>oid</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-foreign-server.md"><code>pg\_foreign\_server</code></a>.<code>oid</code>）</p><p>此外部資料表之外部伺服器的 OID</p>                                                                                     |
| <p><code>ftoptions</code> <code>text\[]</code></p><p>外部資料表選項，以 “keyword=value” 字串形式呈現</p>                                                                                                                                                                                                                    |

<br>

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/catalog-pg-foreign-table.html)（原文版本：18.6；核對日期：2026-10-17）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-foreign-table.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
