| От | Kelly Burkhart |
|---|---|
| Тема | Re: Problems with sequences |
| Дата | |
| Msg-id | fa1e4ce70609071056q407364cah74a049ffdd6514c2@mail.gmail.com обсуждение |
| Ответ на | Problems with sequences ("Arturo Perez" <aperez@hayesinc.com>) |
| Список | pgsql-general |
On 9/6/06, Arturo Perez <aperez@hayesinc.com> wrote:
> What happens is that if I do a select nextval('seq') I get a number
> that's lower than the
> max primary key id. This is inspite of my doing
> SELECT setval('seq', ((SELECT MAX(seq_ID) FROM table)+1))
> ALTER SEQUENCE seq RESTART WITH <max + 1>;
> select pg_catalog.setval(seq, <max+1>, true);
Your sequence was probably created with the CACHE parameter. This
will cause each session to cache n values from the sequence.
Resetting the sequence from another session will not affect the others
until they've gone through all their cached values.
-K
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера