> 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/the-sql-language/functions/functions-info/functions-info-comment.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 9.27.6. 註解資訊函式

## 9.27.6. 註解資訊函式 [#](#functions-info-comment) <a href="#functions-info-comment" id="functions-info-comment"></a>

[表 9.82](#functions-info-comment-table) 所列的函式會擷取先前以 [COMMENT](https://docs.postgresql.tw/19/reference/sql-commands/sql-comment.md) 指令儲存的註解。如果找不到符合指定參數的註解，則回傳 NULL 值。

### 表 9.82. 註解資訊函式 [#](#functions-info-comment-table) <a href="#functions-info-comment-table" id="functions-info-comment-table"></a>

| <p>函式</p><p>說明</p>                                                                                                                                                                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>col\_description</code> ( <em><code>table</code></em> <code>oid</code>, <em><code>column</code></em> <code>integer</code> ) → <code>text</code></p><p>回傳資料表欄位的註解，該欄位以其所屬資料表的 OID 與欄位編號指定。（<code>obj\_description</code> 無法用於資料表欄位，因為欄位沒有自己的 OID。）</p>                                                        |
| <p><code>obj\_description</code> ( <em><code>object</code></em> <code>oid</code>, <em><code>catalog</code></em> <code>name</code> ) → <code>text</code></p><p>回傳以 OID 與所在系統目錄名稱指定之資料庫物件的註解。例如，<code>obj\_description(123456, 'pg\_class')</code> 會擷取 OID 為 123456 之資料表的註解。</p>                                        |
| <p><code>obj\_description</code> ( <em><code>object</code></em> <code>oid</code> ) → <code>text</code></p><p>回傳僅以 OID 指定之資料庫物件的註解。這種用法<em>已棄用</em>，因為無法保證 OID 在不同的系統目錄之間是唯一的；因此，可能會回傳錯誤的註解。</p>                                                                                                                       |
| <p><code>shobj\_description</code> ( <em><code>object</code></em> <code>oid</code>, <em><code>catalog</code></em> <code>name</code> ) → <code>text</code></p><p>回傳以 OID 與所在系統目錄名稱指定之共享資料庫物件的註解。這與 <code>obj\_description</code> 相同，只不過它是用來擷取共享物件（也就是資料庫、角色與資料表空間）的註解。有些系統目錄對每個叢集中的所有資料庫而言是全域的，而其中物件的描述也同樣以全域方式儲存。</p> |

<br>

[返回 9.27. 系統資訊函式與運算子](https://docs.postgresql.tw/19/the-sql-language/functions/functions-info.md#functions-info)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/functions-info.html)（原文版本：18.6；核對日期：2026-09-11）


---

# 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/the-sql-language/functions/functions-info/functions-info-comment.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.
