Sequences
Sequences are database objects that generate ordered numeric values, commonly used for auto-incrementing primary keys. Zequel provides a dedicated view for browsing and creating sequences in PostgreSQL.
Viewing Sequences
- Connect to a PostgreSQL database and expand the schema in the sidebar.
- Click the Sequences entry under the schema.
- A list of all sequences in the schema is displayed, showing key properties for each.
The sequence list includes the following details:
| Property | Description |
|---|---|
| Name | The sequence identifier. |
| Start value | The initial value of the sequence. |
| Min value | The minimum value the sequence can reach. |
| Max value | The maximum value the sequence can reach. |
| Increment | The step size between consecutive values. |
| Current value | The last value returned by the sequence. |
| Cycle | Whether the sequence wraps around after reaching its limit. |
Creating a Sequence
- Click the Create Sequence button in the toolbar to open the Create Sequence dialog.
- Fill in the sequence properties:
- Name -- A unique name for the sequence within the schema.
- Start value -- The first value the sequence will produce.
- Increment -- How much the value increases (or decreases) with each call.
- Min value and Max value -- Optional bounds for the sequence.
- Cycle -- Toggle this on if the sequence should restart from the minimum value after reaching the maximum.
- Click Create to execute the
CREATE SEQUENCEstatement.
The new sequence appears in the sidebar immediately after creation.
Supported Databases
Sequences are a PostgreSQL-specific feature in Zequel:
- PostgreSQL
