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

# 52.28. pg\_init\_privs \#

### 52.28. `pg_init_privs` [#](#catalog-pg-init-privs) <a href="#catalog-pg-init-privs" id="catalog-pg-init-privs"></a>

目錄 `pg_init_privs` 記錄系統中物件之初始權限的相關資訊。資料庫中每個具有非預設（非 NULL）初始權限集合的物件，都各有一個項目。

物件取得初始權限的方式有兩種：一是在系統初始化時（由 initdb）設定這些權限；二是物件在 [`CREATE EXTENSION`](https://docs.postgresql.tw/19/reference/sql-commands/sql-createextension.md) 期間建立，且擴充功能腳本使用 [`GRANT`](https://docs.postgresql.tw/19/reference/sql-commands/sql-grant.md) 系統設定初始權限。請注意，系統會在擴充功能腳本執行期間自動處理權限的記錄，擴充功能作者只需在腳本中使用 `GRANT` 與 `REVOKE` 陳述式，即可讓這些權限被記錄下來。`privtype` 欄位指出初始權限是由 initdb 設定，還是在 `CREATE EXTENSION` 命令期間設定。

初始權限由 initdb 設定的物件，其項目的 `privtype` 為 `'i'`；初始權限由 `CREATE EXTENSION` 設定的物件，其項目的 `privtype` 為 `'e'`。

#### 表 52.28. `pg_init_privs` 欄位 [#](#catalog-pg-init-privs-columns) <a href="#catalog-pg-init-privs-columns" id="catalog-pg-init-privs-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>objoid</code> <code>oid</code> （參照任何 OID 欄位）</p><p>特定物件的 OID</p>                                                                                                                           |
| <p><code>classoid</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>此物件所在之系統目錄的 OID</p> |
| <p><code>objsubid</code> <code>int4</code></p><p>對於資料表欄位，這是欄位編號（<code>objoid</code> 與 <code>classoid</code> 參照資料表本身）。對於所有其他物件類型，此欄位為零。</p>                                                          |
| <p><code>privtype</code> <code>char</code></p><p>定義此物件初始權限類型的代碼；請參閱本文</p>                                                                                                                           |
| <p><code>initprivs</code> <code>aclitem\[]</code></p><p>初始存取權限；詳細資訊請參閱<a href="https://docs.postgresql.tw/19/the-sql-language/ddl/ddl-priv.md">第 5.8 節</a></p>                                      |

<br>

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/catalog-pg-init-privs.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-init-privs.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.
