Updated on 2024-09-30 GMT+08:00

PG_SEQUENCES

PG_SEQUENCES displays the sequence attributes on which the current user has permissions. This view is supported only by clusters of version 9.1.0 or later.

Table 1 PG_SEQUENCES columns

Column

Type

Description

schemaname

name

Name of the namespace.

sequencename

name

Name of the sequence

sequenceowner

name

Owner of the sequence

start_value

bigint

Start value of the sequence.

min_value

bigint

Minimum value generated by the sequence.

max_value

bigint

Maximum value generated by the sequence.

increment_by

bigint

Amount by which the generated value increases each time in a sequence.

cycle

boolean

If set to true, the sequence value restarts from the minimum value after reaching the maximum value. If set to false, the sequence value stops generating after reaching the maximum value.

cache_size

bigint

Size of the sequence cache value.

last_value

bigint

Most recently generated value of the sequence.