> 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/internals/views/view-pg-sequences.md).

# 53.24. pg\_sequences \#

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

**Table 53.24. `pg_sequences` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><code>schemaname</code> <code>name</code> (references <a href="/pages/p7uH9oRd2ZTbQCzy1qKB"><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="/pages/b1fii6hWVNacZFXaxWON"><code>pg\_class</code></a>.<code>relname</code>)</p><p>Name of sequence</p>                     |
| <p><code>sequenceowner</code> <code>name</code> (references <a href="/pages/nyEMOe5gQKgypFQTDbjS"><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="/pages/Rnbzy6x669U98OjJh3D7"><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> |

<br>

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 18.6 Documentation](https://www.postgresql.org/docs/18/view-pg-sequences.html)（英文原文，待翻譯）


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.postgresql.tw/internals/views/view-pg-sequences.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
