Обсуждение: BUG #14442: serial maxvalue incorrect

Поиск
Список
Период
Сортировка

BUG #14442: serial maxvalue incorrect

От
josipa.milic@gmail.com
Дата:
VGhlIGZvbGxvd2luZyBidWcgaGFzIGJlZW4gbG9nZ2VkIG9uIHRoZSB3ZWJz
aXRlOgoKQnVnIHJlZmVyZW5jZTogICAgICAxNDQ0MgpMb2dnZWQgYnk6ICAg
ICAgICAgIGpvc2lwYSBtaWxpYwpFbWFpbCBhZGRyZXNzOiAgICAgIGpvc2lw
YS5taWxpY0BnbWFpbC5jb20KUG9zdGdyZVNRTCB2ZXJzaW9uOiA5LjUuMApP
cGVyYXRpbmcgc3lzdGVtOiAgIHdpbmRvd3MgNwpEZXNjcmlwdGlvbjogICAg
ICAgIAoKV2hlbiB0YWJsZSBpcyBnZW5lcmF0ZWQgdXNpbmcgcGdhZG1pbiwg
c2VxdWVuY2UgZ2VuZXJhdGVkIGFzIHNlcmlhbCBoYXMgdGhlCnNhbWUgbWF4
dmFsdWUgYXMgYmlnc2VyaWFsOiA5MjIzMzcyMDM2ODU0Nzc1ODA3DQoNCkl0
IHNob3VsZCBiZSBtYXggdmFsdWUgdGhhdCBjb3JyZXNwb25kcyB0byBpbnRl
Z2VyOiAyMTQ3NDgzNjQ3Cgo=

Re: BUG #14442: serial maxvalue incorrect

От
Tom Lane
Дата:
josipa.milic@gmail.com writes:
> When table is generated using pgadmin, sequence generated as serial has the
> same maxvalue as bigserial: 9223372036854775807

Yup.

> It should be max value that corresponds to integer: 2147483647

No, that's intentional.  If you never run out of serial numbers,
it's not going to matter.  If you do run out, you'll get an error
anyway (from trying to stuff a value > 2147483647 into an integer
column).  And the sequence limit will be one less thing you'll
have to change on the way to fixing it.

            regards, tom lane

Re: BUG #14442: serial maxvalue incorrect

От
Peter Eisentraut
Дата:
On 11/30/16 4:34 AM, josipa.milic@gmail.com wrote:
> When table is generated using pgadmin, sequence generated as serial has the
> same maxvalue as bigserial: 9223372036854775807
>
> It should be max value that corresponds to integer: 2147483647

There is a pending proposal to address that:
https://www.postgresql.org/message-id/flat/898deb94-5265-37cf-f199-4f79ef864536@2ndquadrant.com

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services