Re: is an explicit lock necessary?

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: is an explicit lock necessary?
Следующее
От: Ragnar
Дата:
Сообщение: Re: is an explicit lock necessary?