The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.

Sequence Manipulation Functions

Last updated: 2024-08-22 16:23:32

The database supports sequences. Sequence objects are special single-row tables, created using CREATE SEQUENCE. A sequence is typically used to generate unique table data. The functions of a sequence are as follows. For example, to create a sequence:CREATE SEQUENCE myseq START 101;.
Function
Returned values
Description
Result
nextval('myseq')
bigint
The sequence auto-increments and returns the latest value
101
setval('myseq',102)
bigint
Sets sequence's current value
102