Sequence Manager

Top Previous Next

Sequence Manager allows you to add, edit and delete Sequences within the diagram. To open Sequence Manager, select the Diagram | Sequence Manager menu item.

Sequence is a virtual object of a diagram and has no graphical representation. After defining a Sequence, it appears in the object editors, so that you could attach other diagram objects to it.

Sequences tab

Sequence Manager contains a grid that represents Sequences available in the diagram and their properties. The Sequence properties you can change in the grid are as follows:

Sequence name

The name of a Sequence to be created. The name cannot begin with pg_, as such names are reserved for system Sequences.


The database schema that sequence belongs to.


Comment to the Sequence.


The name of the user who will own the Sequence. If omitted, defaults to the user executing the command. Only superusers may create Sequences owned by users other than themselves.


Specifies which value is added to the current sequence value to create a new value. A positive value will make an ascending sequence, a negative one a descending sequence. If omitted then the default value is 1.


Determines the minimum value a sequence can generate. If this clause is not supplied then defaults will be used. The defaults are 1 and -263-1 for ascending and descending sequences, respectively.


Determines the maximum value for the sequence. If this clause is not supplied then default values will be used. The defaults are 263-1 and -1 for ascending and descending sequences, respectively.


Allows the sequence to begin anywhere. The default starting value is minvalue for ascending sequences and maxvalue for descending ones.


Specifies how many sequence numbers are to be preallocated and stored in memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e., no cache), and this is also the default.


Allows the sequence to wrap around when the maxvalue or minvalue has been reached by an ascending or descending sequence respectively. If the limit is reached, the next number generated will be the minvalue or maxvalue, respectively. If unchecked, any calls to nextval after the sequence has reached its maximum value will return an error.

The buttons below the list of Sequences allow you to perform the following actions:

Add - add a new Sequence with the default properties to the end of the list;

Duplicate - add a new Sequence with the same properties as the selected Sequence to the end of the list;

Delete - remove the selected Sequence from the list.

Preview tab

The Preview tab displays the SQL statement, which will be executed during the database generation. This statement is made up according to the changes you have made using the previous tabs. Please note that the text within the editor is read-only. The content of this tab updates only when your press the Apply button.