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

# 9.27.3. 綱要可見性查詢函式

## 9.27.3. 綱要可見性查詢函式 [#](#functions-info-schema) <a href="#functions-info-schema" id="functions-info-schema"></a>

[表 9.75](#functions-info-schema-table) 列出了用來判斷某個物件在目前的綱要搜尋路徑中是否*可見*的函式。舉例來說，如果一個資料表所屬的綱要位於搜尋路徑中，並且搜尋路徑中較前面的位置沒有同名的資料表，就稱該資料表是可見的。這等同於說，該資料表可以只用名稱來引用，而不需明確的綱要限定。因此，要列出所有可見資料表的名稱：

```

SELECT relname FROM pg_class WHERE pg_table_is_visible(oid);
```

對於函式與運算子而言，如果搜尋路徑中較前面的位置沒有名稱*與引數資料型別*都相同的物件，就稱搜尋路徑中的該物件是可見的。對於運算子類別與運算子家族，則會同時考慮名稱與相關聯的索引存取方法。

### 表 9.75. 綱要可見性查詢函式 [#](#functions-info-schema-table) <a href="#functions-info-schema-table" id="functions-info-schema-table"></a>

| <p>函式</p><p>說明</p>                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><code>pg\_collation\_is\_visible</code> ( <em><code>collation</code></em> <code>oid</code> ) → <code>boolean</code></p><p>定序在搜尋路徑中是否可見？</p>                                 |
| <p><code>pg\_conversion\_is\_visible</code> ( <em><code>conversion</code></em> <code>oid</code> ) → <code>boolean</code></p><p>編碼轉換（conversion）在搜尋路徑中是否可見？</p>                 |
| <p><code>pg\_function\_is\_visible</code> ( <em><code>function</code></em> <code>oid</code> ) → <code>boolean</code></p><p>函式在搜尋路徑中是否可見？（這也適用於程序與彙總函式。）</p>                    |
| <p><code>pg\_opclass\_is\_visible</code> ( <em><code>opclass</code></em> <code>oid</code> ) → <code>boolean</code></p><p>運算子類別在搜尋路徑中是否可見？</p>                                  |
| <p><code>pg\_operator\_is\_visible</code> ( <em><code>operator</code></em> <code>oid</code> ) → <code>boolean</code></p><p>運算子在搜尋路徑中是否可見？</p>                                  |
| <p><code>pg\_opfamily\_is\_visible</code> ( <em><code>opclass</code></em> <code>oid</code> ) → <code>boolean</code></p><p>運算子家族在搜尋路徑中是否可見？</p>                                 |
| <p><code>pg\_statistics\_obj\_is\_visible</code> ( <em><code>stat</code></em> <code>oid</code> ) → <code>boolean</code></p><p>統計資訊物件在搜尋路徑中是否可見？</p>                            |
| <p><code>pg\_table\_is\_visible</code> ( <em><code>table</code></em> <code>oid</code> ) → <code>boolean</code></p><p>資料表在搜尋路徑中是否可見？（這適用於所有種類的關聯，包括檢視表、具體化檢視表、索引、序列與外部資料表。）</p> |
| <p><code>pg\_ts\_config\_is\_visible</code> ( <em><code>config</code></em> <code>oid</code> ) → <code>boolean</code></p><p>全文檢索設定在搜尋路徑中是否可見？</p>                               |
| <p><code>pg\_ts\_dict\_is\_visible</code> ( <em><code>dict</code></em> <code>oid</code> ) → <code>boolean</code></p><p>全文檢索字典在搜尋路徑中是否可見？</p>                                   |
| <p><code>pg\_ts\_parser\_is\_visible</code> ( <em><code>parser</code></em> <code>oid</code> ) → <code>boolean</code></p><p>全文檢索剖析器在搜尋路徑中是否可見？</p>                              |
| <p><code>pg\_ts\_template\_is\_visible</code> ( <em><code>template</code></em> <code>oid</code> ) → <code>boolean</code></p><p>全文檢索範本在搜尋路徑中是否可見？</p>                           |
| <p><code>pg\_type\_is\_visible</code> ( <em><code>type</code></em> <code>oid</code> ) → <code>boolean</code></p><p>型別（或值域）在搜尋路徑中是否可見？</p>                                      |

<br>

這些函式全都需要以物件 OID 來識別要檢查的物件。如果你想以名稱來測試物件，使用 OID 別名型別（`regclass`、`regtype`、`regprocedure`、`regoperator`、`regconfig` 或 `regdictionary`）會很方便，例如：

```

SELECT pg_type_is_visible('myschema.widget'::regtype);
```

請注意，以這種方式測試未經綱要限定的型別名稱並沒有太大意義——如果這個名稱能夠被辨識，它就必定是可見的。

[返回 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-schema.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.
