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

# 53.24. pg\_sequences \#

### 53.24. `pg_sequences` [#](#view-pg-sequences) <a href="#view-pg-sequences" id="view-pg-sequences"></a>

檢視表 `pg_sequences` 提供對資料庫中每個序列之實用資訊的存取。

#### 表 53.24. `pg_sequences` 欄位 [#](#view-pg-sequences-columns) <a href="#view-pg-sequences-columns" id="view-pg-sequences-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>schemaname</code> <code>name</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-namespace.md"><code>pg\_namespace</code></a>.<code>nspname</code>）</p><p>包含序列之綱要的名稱</p> |
| <p><code>sequencename</code> <code>name</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-class.md"><code>pg\_class</code></a>.<code>relname</code>）</p><p>序列名稱</p>             |
| <p><code>sequenceowner</code> <code>name</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-authid.md"><code>pg\_authid</code></a>.<code>rolname</code>）</p><p>序列擁有者的名稱</p>      |
| <p><code>data\_type</code> <code>regtype</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-type.md"><code>pg\_type</code></a>.<code>oid</code>）</p><p>序列的資料型別</p>               |
| <p><code>start\_value</code> <code>int8</code></p><p>序列的起始值</p>                                                                                                                                               |
| <p><code>min\_value</code> <code>int8</code></p><p>序列的最小值</p>                                                                                                                                                 |
| <p><code>max\_value</code> <code>int8</code></p><p>序列的最大值</p>                                                                                                                                                 |
| <p><code>increment\_by</code> <code>int8</code></p><p>序列的遞增值</p>                                                                                                                                              |
| <p><code>cycle</code> <code>bool</code></p><p>序列是否循環</p>                                                                                                                                                      |
| <p><code>cache\_size</code> <code>int8</code></p><p>序列的快取大小</p>                                                                                                                                               |
| <p><code>last\_value</code> <code>int8</code></p><p>最後寫入磁碟的序列值。若使用了快取，此值可能大於序列最後一次發出的值。</p>                                                                                                                   |

<br>

若下列任一條件成立，`last_value` 欄位讀出的值將為 null：

* 此序列尚未被讀取過。
* 目前使用者對此序列既沒有 `USAGE` 權限，也沒有 `SELECT` 權限。
* 此序列為無日誌序列，且伺服器為待命伺服器。

***

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


---

# 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/views/view-pg-sequences.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.
