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

# 35.45. routines \#

### 35.45. `routines` [#](#infoschema-routines) <a href="#infoschema-routines" id="infoschema-routines"></a>

檢視表 `routines` 包含目前資料庫中的所有函式與程序。只有目前使用者可存取的函式與程序才會顯示（使用者為其擁有者或具有某項權限時即可存取）。

#### 表 35.43. `routines` 欄位 [#](#infoschema-routines-columns) <a href="#infoschema-routines-columns" id="infoschema-routines-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>specific\_catalog</code> <code>sql\_identifier</code></p><p>包含該函式的資料庫名稱（一律為目前資料庫）</p>                                                                                                                                                  |
| <p><code>specific\_schema</code> <code>sql\_identifier</code></p><p>包含該函式的綱要名稱</p>                                                                                                                                                              |
| <p><code>specific\_name</code> <code>sql\_identifier</code></p><p>函式的“特定名稱”。這是在綱要中唯一識別該函式的名稱，即使函式的實際名稱被多載也是如此。特定名稱的格式並未定義，只應該用來與其他特定常式名稱的實例進行比較。</p>                                                                                            |
| <p><code>routine\_catalog</code> <code>sql\_identifier</code></p><p>包含該函式的資料庫名稱（一律為目前資料庫）</p>                                                                                                                                                   |
| <p><code>routine\_schema</code> <code>sql\_identifier</code></p><p>包含該函式的綱要名稱</p>                                                                                                                                                               |
| <p><code>routine\_name</code> <code>sql\_identifier</code></p><p>函式名稱（多載時可能重複）</p>                                                                                                                                                              |
| <p><code>routine\_type</code> <code>character\_data</code></p><p>函式為 <code>FUNCTION</code>，程序為 <code>PROCEDURE</code></p>                                                                                                                       |
| <p><code>module\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                   |
| <p><code>module\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                    |
| <p><code>module\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                      |
| <p><code>udt\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                      |
| <p><code>udt\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                       |
| <p><code>udt\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                         |
| <p><code>data\_type</code> <code>character\_data</code></p><p>若函式的回傳資料型別為內建型別，則為該型別；若為某種陣列，則為 <code>ARRAY</code>（此時請參閱檢視表 <code>element\_types</code>）；否則為 <code>USER-DEFINED</code>（此時型別由 <code>type\_udt\_name</code> 及相關欄位識別）。程序則為 null。</p> |
| <p><code>character\_maximum\_length</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                       |
| <p><code>character\_octet\_length</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                         |
| <p><code>character\_set\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                           |
| <p><code>character\_set\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                            |
| <p><code>character\_set\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                              |
| <p><code>collation\_catalog</code> <code>sql\_identifier</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                                |
| <p><code>collation\_schema</code> <code>sql\_identifier</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                                 |
| <p><code>collation\_name</code> <code>sql\_identifier</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                                   |
| <p><code>numeric\_precision</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                               |
| <p><code>numeric\_precision\_radix</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                        |
| <p><code>numeric\_scale</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                                   |
| <p><code>datetime\_precision</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                              |
| <p><code>interval\_type</code> <code>character\_data</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                                    |
| <p><code>interval\_precision</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於回傳資料型別</p>                                                                                                                              |
| <p><code>type\_udt\_catalog</code> <code>sql\_identifier</code></p><p>定義函式回傳資料型別的資料庫名稱（一律為目前資料庫）。程序則為 null。</p>                                                                                                                                 |
| <p><code>type\_udt\_schema</code> <code>sql\_identifier</code></p><p>定義函式回傳資料型別的綱要名稱。程序則為 null。</p>                                                                                                                                             |
| <p><code>type\_udt\_name</code> <code>sql\_identifier</code></p><p>函式回傳資料型別的名稱。程序則為 null。</p>                                                                                                                                                   |
| <p><code>scope\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                    |
| <p><code>scope\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                     |
| <p><code>scope\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                       |
| <p><code>maximum\_cardinality</code> <code>cardinal\_number</code></p><p>一律為 null，因為在 PostgreSQL 中陣列的最大基數一律為無限制</p>                                                                                                                             |
| <p><code>dtd\_identifier</code> <code>sql\_identifier</code></p><p>此函式回傳資料型別之資料型別描述子的識別碼，在與該函式相關的資料型別描述子中是唯一的。這主要用於與此類識別碼的其他實例進行連接。（識別碼的具體格式並未定義，也不保證在未來版本中維持不變。）</p>                                                                           |
| <p><code>routine\_body</code> <code>character\_data</code></p><p>若函式為 SQL 函式，則為 <code>SQL</code>；否則為 <code>EXTERNAL</code>。</p>                                                                                                                 |
| <p><code>routine\_definition</code> <code>character\_data</code></p><p>函式的原始碼文字（若函式不是由目前已啟用的角色所擁有，則為 null）。（依照 SQL 標準，此欄位只在 <code>routine\_body</code> 為 <code>SQL</code> 時適用，但在 PostgreSQL 中，它會包含建立函式時所指定的任何原始碼文字。）</p>                        |
| <p><code>external\_name</code> <code>character\_data</code></p><p>若此函式為 C 函式，則為函式的外部名稱（連結符號）；否則為 null。（其結果與 <code>routine\_definition</code> 中顯示的值相同。）</p>                                                                                      |
| <p><code>external\_language</code> <code>character\_data</code></p><p>撰寫該函式所用的語言</p>                                                                                                                                                            |
| <p><code>parameter\_style</code> <code>character\_data</code></p><p>一律為 <code>GENERAL</code>（SQL 標準定義了其他參數風格，但 PostgreSQL 中未提供這些風格。）</p>                                                                                                        |
| <p><code>is\_deterministic</code> <code>yes\_or\_no</code></p><p>若函式宣告為不可變（immutable；在 SQL 標準中稱為 deterministic），則為 <code>YES</code>；否則為 <code>NO</code>。（你無法透過資訊綱要查詢 PostgreSQL 中可用的其他易變性等級。）</p>                                               |
| <p><code>sql\_data\_access</code> <code>character\_data</code></p><p>一律為 <code>MODIFIES</code>，表示該函式可能會修改 SQL 資料。此資訊對 PostgreSQL 沒有用處。</p>                                                                                                      |
| <p><code>is\_null\_call</code> <code>yes\_or\_no</code></p><p>若函式在任一引數為 null 時會自動傳回 null，則為 <code>YES</code>；否則為 <code>NO</code>。程序則為 null。</p>                                                                                                 |
| <p><code>sql\_path</code> <code>character\_data</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                         |
| <p><code>schema\_level\_routine</code> <code>yes\_or\_no</code></p><p>一律為 <code>YES</code>（相反的情況是使用者定義型別的方法，這是 PostgreSQL 中未提供的功能。）</p>                                                                                                         |
| <p><code>max\_dynamic\_result\_sets</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                       |
| <p><code>is\_user\_defined\_cast</code> <code>yes\_or\_no</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                               |
| <p><code>is\_implicitly\_invocable</code> <code>yes\_or\_no</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                             |
| <p><code>security\_type</code> <code>character\_data</code></p><p>若函式以目前使用者的權限執行，則為 <code>INVOKER</code>；若函式以定義它的使用者的權限執行，則為 <code>DEFINER</code>。</p>                                                                                          |
| <p><code>to\_sql\_specific\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                        |
| <p><code>to\_sql\_specific\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                         |
| <p><code>to\_sql\_specific\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                           |
| <p><code>as\_locator</code> <code>yes\_or\_no</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                           |
| <p><code>created</code> <code>time\_stamp</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                               |
| <p><code>last\_altered</code> <code>time\_stamp</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                         |
| <p><code>new\_savepoint\_level</code> <code>yes\_or\_no</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                 |
| <p><code>is\_udt\_dependent</code> <code>yes\_or\_no</code></p><p>目前一律為 <code>NO</code>。另一個值 <code>YES</code> 適用於 PostgreSQL 中未提供的功能。</p>                                                                                                       |
| <p><code>result\_cast\_from\_data\_type</code> <code>character\_data</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                    |
| <p><code>result\_cast\_as\_locator</code> <code>yes\_or\_no</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                             |
| <p><code>result\_cast\_char\_max\_length</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                  |
| <p><code>result\_cast\_char\_octet\_length</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                |
| <p><code>result\_cast\_char\_set\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                  |
| <p><code>result\_cast\_char\_set\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                   |
| <p><code>result\_cast\_char\_set\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                     |
| <p><code>result\_cast\_collation\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                  |
| <p><code>result\_cast\_collation\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                   |
| <p><code>result\_cast\_collation\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                     |
| <p><code>result\_cast\_numeric\_precision</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                 |
| <p><code>result\_cast\_numeric\_precision\_radix</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                          |
| <p><code>result\_cast\_numeric\_scale</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                     |
| <p><code>result\_cast\_datetime\_precision</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                |
| <p><code>result\_cast\_interval\_type</code> <code>character\_data</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                      |
| <p><code>result\_cast\_interval\_precision</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                |
| <p><code>result\_cast\_type\_udt\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                  |
| <p><code>result\_cast\_type\_udt\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                   |
| <p><code>result\_cast\_type\_udt\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                     |
| <p><code>result\_cast\_scope\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                      |
| <p><code>result\_cast\_scope\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                       |
| <p><code>result\_cast\_scope\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                         |
| <p><code>result\_cast\_maximum\_cardinality</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                               |
| <p><code>result\_cast\_dtd\_identifier</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                     |

<br>

***

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


---

# 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/client-interfaces/information-schema/infoschema-routines.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.
