50.85. pg_sequences

Представление pg_sequences даёт доступ к полезной информации обо всех последовательностях в базе данных.

Таблица 50.86. Столбцы pg_sequences

ИмяТипСсылкиОписание
schemanamenamepg_namespace.nspnameИмя схемы, содержащей последовательность
sequencenamenamepg_class.relnameИмя последовательности
sequenceownernamepg_authid.rolnameИмя владельца последовательности
data_typeregtypepg_type.oidТип данных последовательности
start_valuebigint Начальное значение последовательности
min_valuebigint Минимальное значение последовательности
max_valuebigint Максимальное значение последовательности
increment_bybigint Шаг увеличения последовательности
cycleboolean Зацикливается ли последовательность
cache_sizebigint Размер кеша последовательности
last_valuebigint Последнее значение последовательности, записанное на диск. Если используется кеширование, это значение может быть больше последнего значения, полученного из последовательности. Если к этой последовательности ещё не обращались, содержит NULL. Также содержит NULL, если текущий пользователь не имеет права USAGE или SELECT.

50.85. pg_sequences

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

Table 50.86. pg_sequences Columns

NameTypeReferencesDescription
schemanamenamepg_namespace.nspnameName of schema containing sequence
sequencenamenamepg_class.relnameName of sequence
sequenceownernamepg_authid.rolnameName of sequence's owner
data_typeregtypepg_type.oidData type of the sequence
start_valuebigint Start value of the sequence
min_valuebigint Minimum value of the sequence
max_valuebigint Maximum value of the sequence
increment_bybigint Increment value of the sequence
cycleboolean Whether the sequence cycles
cache_sizebigint Cache size of the sequence
last_valuebigint 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. Null if the sequence has not been read from yet. Also, if the current user does not have USAGE or SELECT privilege on the sequence, the value is null.

FAQ