> 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/15/internals/54.-system-views/pg_sequences.md).

# 54.23. pg\_sequences

## 54.23. pg\_sequences

The view `pg_sequences` provides access to useful information about each sequence in the database.

**Table 54.23. `pg_sequences` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><code>schemaname</code> <code>name</code> (references <a href="/15/internals/system-catalogs/pg_namespace.md"><code>pg\_namespace</code></a>.<code>nspname</code>)</p><p>Name of schema containing sequence</p> |
| <p><code>sequencename</code> <code>name</code> (references <a href="/15/internals/system-catalogs/pg_class.md"><code>pg\_class</code></a>.<code>relname</code>)</p><p>Name of sequence</p>                         |
| <p><code>sequenceowner</code> <code>name</code> (references <a href="/15/internals/system-catalogs/pg_authid.md"><code>pg\_authid</code></a>.<code>rolname</code>)</p><p>Name of sequence's owner</p>              |
| <p><code>data\_type</code> <code>regtype</code> (references <a href="/15/internals/system-catalogs/pg_type.md"><code>pg\_type</code></a>.<code>oid</code>)</p><p>Data type of the sequence</p>                     |
| <p><code>start\_value</code> <code>int8</code></p><p>Start value of the sequence</p>                                                                                                                               |
| <p><code>min\_value</code> <code>int8</code></p><p>Minimum value of the sequence</p>                                                                                                                               |
| <p><code>max\_value</code> <code>int8</code></p><p>Maximum value of the sequence</p>                                                                                                                               |
| <p><code>increment\_by</code> <code>int8</code></p><p>Increment value of the sequence</p>                                                                                                                          |
| <p><code>cycle</code> <code>bool</code></p><p>Whether the sequence cycles</p>                                                                                                                                      |
| <p><code>cache\_size</code> <code>int8</code></p><p>Cache size of the sequence</p>                                                                                                                                 |
| <p><code>last\_value</code> <code>int8</code></p><p>The last sequence value written to disk. If caching is used, this value can be greater than the last value handed out from the sequence.</p>                   |

The `last_value` column will read as null if any of the following are true:

* The sequence has not been read from yet.
* The current user does not have `USAGE` or `SELECT` privilege on the sequence.
* The sequence is unlogged and the server is a standby.

***

原文：[PostgreSQL 15.19 Documentation](/15/internals/54.-system-views/pg_sequences.md)（英文原文，待翻譯）


---

# 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/15/internals/54.-system-views/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.
