Skip to content

Commit

Permalink
Correct sequence scaffolding for PG 10
Browse files Browse the repository at this point in the history
Fixes #264
  • Loading branch information
roji committed Nov 19, 2017
1 parent a33f857 commit bdcf998
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,10 @@ void GetSequences()
Debug.Assert(sequence.MinValue.HasValue);
defaultStart = sequence.MinValue.Value;
} else {
defaultMin = long.MinValue + 1;
// PostgreSQL 10 changed the default minvalue for a descending sequence, see #264
defaultMin = _connection.PostgreSqlVersion >= new Version(10,0)
? long.MinValue
: long.MinValue + 1;
defaultMax = -1;
Debug.Assert(sequence.MaxValue.HasValue);
defaultStart = sequence.MaxValue.Value;
Expand Down

0 comments on commit bdcf998

Please sign in to comment.