| От | Woody Woodring |
|---|---|
| Тема | Should SERIAL column have MAXVAL set on sequence |
| Дата | |
| Msg-id | 017901c7cd42$ee6090b0$80b1a8c0@istructure.com обсуждение исходный текст |
| Ответы |
Re: Should SERIAL column have MAXVAL set on sequence
|
| Список | pgsql-general |
I have a table in our DB that functions as a queue with a SERIAL column for its primary key. At 4am this weekend I started getting the error: ERROR: integer out of range Which was attributed to the sequence incrementing past the size of the int4 serial column after several years of operation. I was able to set the sequence back to 1 and everything was happy. I was wondering if the SERIAL column should set the MAXVAL=2147483647 when it creates the sequence? I ended up fixing my queue table with the following to avoid the issue in the future: ALTER SEQUENCE transfer_transferid_seq MAXVALUE 2147483647 CYCLE; Thanks, Woody ---------------------------------------- iGLASS Networks 211-A S. Salem St Apex NC 27502 (919) 387-3550 x813 www.iglass.net
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера