Re: Practical question.

Поиск
Список
Период
Сортировка
От louis gonzales
Тема Re: Practical question.
Дата
Msg-id 45FA1BA0.6060606@linuxlouis.net
обсуждение исходный текст
Ответ на Re: Practical question.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
:) , something that is analogous to a race condition.  is this something
I shouldn't be concerned with?
I suppose if I knew for certain there was some kind of synchronous
behavior, then I wouldn't fear a potentially subsequent event completing
before the previous one doing so.

As a possible solution, I'm thinking that I can make the trigger be a
before trigger, where the before trigger captures the 'nextvalue' for
both the actual insert and the table creation would be based on this,
while incrementing the sequence to guarantee that each successive pull
on the nextvalue will have the correct one.

Does that sound plausible?

Thanks,

Tom Lane wrote:

>louis gonzales <gonzales@linuxlouis.net> writes:
>
>
>>As an example:
>>insertX which initiates the trigger reads the 'nextvalue' from the
>>sequence and begins to create the associcated table
>>insertY happens almost at the same time, so that it gets the same
>>'nextvalue' from the sequence
>>
>>
>
>[ blink... ]  Whatever makes you think that could happen?
>
>            regards, tom lane
>
>


--
Email:    louis.gonzales@linuxlouis.net
WebSite:  http://www.linuxlouis.net
"Open the pod bay doors HAL!" -2001: A Space Odyssey
"Good morning starshine, the Earth says hello." -Willy Wonka


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Practical question.
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Practical question.