| От | Jeffrey Tenny |
|---|---|
| Тема | Atomic query and update of sequence generators |
| Дата | |
| Msg-id | 4005E425.2070706@comcast.net обсуждение исходный текст |
| Ответы |
Re: Atomic query and update of sequence generators
Re: Atomic query and update of sequence generators |
| Список | pgsql-sql |
If I want to allocate a block of adjacent values from a sequence generator,
is the following statement atomic with respect to the time between
when the call to nextval() and setval()?
SELECT setval('foo', nextval()+20) ...
The goal is to get a sequence of 20 values that are all +1 from each other.
If the above isn't safe in concurrent environments, is there something
else I can
do to achieve the effect safely?
I saw a similar unanswered question on one of the PostgreSQL newsgroups,
and have a need to do the same thing from my JDBC app.
Tips appreciated.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера