Re: concurrency problem

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: concurrency problem
Дата
Msg-id 20060619152850.GD31354@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Re: concurrency problem  ("sathish kumar shanmugavelu" <sathishkumar.shanmugavelu@gmail.com>)
Список pgsql-sql
On Sat, Jun 17, 2006 at 09:23:17AM +0530, sathish kumar shanmugavelu wrote:
>   I fetch the consultatioin_no and add one to it, i should know this
> consultation_no to save the other 10 tables. because i use this number as

Don't do that.  Fetch the number from a sequence first: select
nextval().  Then you can insert it as currval() for all your other
INSERTs.  No, there is no race condition or concurrency problem: see
the docs on these functions.  No locks.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
When my information changes, I alter my conclusions.  What do you do sir?    --attr. John Maynard Keynes


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Aaron Bono"
Дата:
Сообщение: Re: concurrency problem
Следующее
От: Jeff Frost
Дата:
Сообщение: Re: keeping last 30 entries of a log table