Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 700bab9

Browse files
committed
Support monotonic sequences
1 parent d7e9e02 commit 700bab9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/commands/sequence.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@ void AdjustSequence(Oid relid, int64 next)
882882
{
883883
Assert(next >= seq->min_value && next <= seq->max_value);
884884

885+
next = last + elm->increment*((next - last + elm->increment)/elm->increment);
886+
885887
/* Set the currval() state only if iscalled = true */
886888
if (seq->is_called)
887889
{

0 commit comments

Comments
 (0)