| От | Stephan Szabo |
|---|---|
| Тема | Re: is an explicit lock necessary? |
| Дата | |
| Msg-id | 20060504114708.I61331@megazone.bigpanda.com обсуждение |
| Ответ на | is an explicit lock necessary? (Ash Grove <ash_grv7@yahoo.com>) |
| Список | pgsql-sql |
On Thu, 4 May 2006, Ash Grove wrote: > Hi, > > Does beginning a transaction put locks on the tables > queried within the transaction? > > In the example below, is #2 necessary? My thought was > that I would need to use an explicit lock to make sure > that the sequence value I'm selecting in #4 is the > same one that is generated from #3. I'm worried about > another instance of the application doing an insert on > table1 between #3 and #4. If you have 1 session per instance and #3 and #4 are done after each other without any intervening commands, the behavior of nextval/currval should guarantee that (currval gives the value from this session's nextval, not any other).
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера