Summary
The view pg_sequences provides access to useful information about each sequence in the database.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_sequences system view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
schemanamenamereferencespg_namespace.nspname
Name of schema containing sequencesequencenamenamereferencespg_class.relname
Name of sequencesequenceownernamereferencespg_authid.rolname
Name of sequence’s ownerdata_typeregtypereferencespg_type.oid
Data type of the sequencestart_valueint8
Start value of the sequencemin_valueint8
Minimum value of the sequencemax_valueint8
Maximum value of the sequenceincrement_byint8
Increment value of the sequencecyclebool
Whether the sequence cyclescache_sizeint8
Cache size of the sequencelast_valueint8
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.
Related catalogs
This object references the following other system catalogs:
schemaname→pg_namespacesequencename→pg_classsequenceowner→pg_authiddata_type→pg_type
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_sequences.