pg_sequences — PostgreSQL system view

The PostgreSQL pg_sequences system view: full column reference (names, types, descriptions), catalog relationships and version support.

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):

  • schemaname name references pg_namespace.nspname
    Name of schema containing sequence
  • sequencename name references pg_class.relname
    Name of sequence
  • sequenceowner name references pg_authid.rolname
    Name of sequence’s owner
  • data_type regtype references pg_type.oid
    Data type of the sequence
  • start_value int8
    Start value of the sequence
  • min_value int8
    Minimum value of the sequence
  • max_value int8
    Maximum value of the sequence
  • increment_by int8
    Increment value of the sequence
  • cycle bool
    Whether the sequence cycles
  • cache_size int8
    Cache size of the sequence
  • last_value int8
    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:

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.