CREATE SEQUENCE minvalue for descending sequence

Started by Klemens Eisensteckenover 8 years ago3 messagesdocs
Jump to latest
#1Klemens Eisenstecken
klemens.eisenstecken@gmail.com

Hello,

while reading your documentation about create sequence I found that you
mention the minvalue for a descending sequence is -263-1.

But as far as I know the minvalue of long is -263+1.

The mentioned documentation is at:
https://www.postgresql.org/docs/9.6/static/sql-createsequence.html

#2Michael Paquier
michael@paquier.xyz
In reply to: Klemens Eisenstecken (#1)
Re: CREATE SEQUENCE minvalue for descending sequence

On Wed, Aug 16, 2017 at 10:00 PM, Klemens Eisenstecken
<klemens.eisenstecken@gmail.com> wrote:

Hello,

while reading your documentation about create sequence I found that you
mention the minvalue for a descending sequence is -2^63-1.

But as far as I know the minvalue of long is -2^63+1.

The mentioned documentation is at:
https://www.postgresql.org/docs/9.6/static/sql-createsequence.html

Logically the minimum value of long is -2^63, the maximum being 2^63 -
1, but as you say the default minvalue of a descending sequence is
-2^63 + 1, so the docs are wrong. Note that Postgres has changed this
idiotic minimal value behavior in 10, using now the real minimum value
of the types used with a sequence.
--
Michael

Attachments:

createseq-docfix.patchapplication/octet-stream; name=createseq-docfix.patchDownload+1-1
#3Klemens Eisenstecken
klemens.eisenstecken@gmail.com
In reply to: Michael Paquier (#2)
Re: CREATE SEQUENCE minvalue for descending sequence

Thank you for the clarification!

Michael Paquier <michael.paquier@gmail.com> schrieb am Do., 17. Aug. 2017
um 04:14 Uhr:

Show quoted text

On Wed, Aug 16, 2017 at 10:00 PM, Klemens Eisenstecken
<klemens.eisenstecken@gmail.com> wrote:

Hello,

while reading your documentation about create sequence I found that you
mention the minvalue for a descending sequence is -2^63-1.

But as far as I know the minvalue of long is -2^63+1.

The mentioned documentation is at:
https://www.postgresql.org/docs/9.6/static/sql-createsequence.html

Logically the minimum value of long is -2^63, the maximum being 2^63 -
1, but as you say the default minvalue of a descending sequence is
-2^63 + 1, so the docs are wrong. Note that Postgres has changed this
idiotic minimal value behavior in 10, using now the real minimum value
of the types used with a sequence.
--
Michael