Sequence is a new object that generates sequence of numbers. It is a user-defined object that is bound to a schema. A sequence object can be used with more than one table. You can also create a sequence cycle to repeat the sequential number after it reaches a limit.
Use the PostgreSQL Sequence Editor to define a sequence in PostgreSQL physical model.
To define a PostgreSQL sequence
An instance of Sequence is created.
The PostgreSQL Sequence Editor opens.
Note: Click New on the toolbar to create a sequence. Use the Enter filter text box to filter a very large list of sequences to quickly locate the one that you want to define.
Specifies the name of the sequence. Set the name of the sequence in this field.
Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.
Specifies the schema for the sequence. Select a schema from the drop-down list or click New to create one.
Allows the sequence to begin anywhere. The default starting value is minimum value for ascending sequences and maximum value for descending ones.
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. The default value is 1.
Specifies the minimum value a sequence can generate. If this clause is not supplied or NO MINVALUE is specified, default values are used.
Specifies the maximum value a sequence can generate. If this clause is not supplied or NO MAXVALUE is specified, default values are used.
Specifies how many sequence numbers are to be preallocated and stored in memory for faster access. The minimum and default value is 1.
Allows the sequence to wrap around when the maximum value or minimum value has been reached by an ascending or descending sequence respectively. If the limit is reached, the next number generated will be the minimum value or maximum value, respectively.
If set to False is specified, any calls to next value after the sequence has reached its maximum value will return an error.
The sequence is defined and the PostgreSQL Sequence Editor closes.
For more information, refer to PostgreSQL documentation.
Copyright © 2017 erwin Inc.
All rights reserved.
|
|