| От | Tom Lane |
|---|---|
| Тема | Re: Usability or Data Bug in SERIAL column declarations |
| Дата | |
| Msg-id | 26562.1098925321@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Usability or Data Bug in SERIAL column declarations (elein <elein@varlena.com>) |
| Список | pgsql-bugs |
elein <elein@varlena.com> writes:
> But shouldn't it wrap when it hits the max?
No, absolutely not. The default sequence behavior is NO CYCLE, meaning
you'll start getting errors from nextval() when you reach the max.
I don't see a lot of difference between getting that error and getting
an int8-to-int4 conversion error.
If someone actually wants wrapping in a serial column, they can adjust
the sequence CYCLE parameter with ALTER SEQUENCE, and fix the maxval
to be what they want at the same time.
Memo to whoever feels like hacking on pg_dump: I believe that any such
manual adjustment to a serial sequence's parameters would be lost over a
dump-n-restore, since pg_dump doesn't emit any CREATE SEQUENCE for it.
Maybe we need an ALTER SEQUENCE in there instead.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера